1
ページを見出しにスクラップできますが、問題はありません。 URLは別の話です。私は は私が形式で保存のための関連URLを引くために何が必要なのか...ということを理解する - - そこbase_url.scraped_fragmentBeautifulsoupを使用してURLのページをスクラップする
from urllib2 import urlopen
import requests
from bs4 import BeautifulSoup
import csv
import MySQLdb
import re
html = urlopen("http://advances.sciencemag.org/")
soup = BeautifulSoup(html.read().decode('utf-8'),"lxml")
#links = soup.findAll("a","href")
headlines = soup.findAll("div", "highwire-cite-title media__headline__title")
for headline in headlines:
text = (headline.get_text())
print text
完璧に動作します! ファンデルワールス金属 - 半導体接合:弱いフェルミレベルのピン止めによって、ショットキー障壁の効果的な調整が可能になります。http://advances.sciencemag.org/content/2/4/e1600069 この声明はどのように見えますか? –
@citramailloあなたは 'headline.get_text()'からそれを調べることができます。ありがとう。 – alecxe