누군가 코드 30,000을 Google에서 Recent News으로 가져와 파이썬을 사용하여 웹 사이트에 표시 할 수 있습니까?파이썬 예제를 사용하여 웹 스크래핑
나는 44 개의 비디오 튜토리얼을보고 기초적인 것을 배웠다.
import urllib2
from BeautifulSoup import BeautifulSoup
# or if your're using BeautifulSoup4:
# from bs4 import BeautifulSoup
soup = BeautifulSoup(urllib2.urlopen('http://www.timeanddate.com/worldclock/astronomy.html?n=78').read())
for row in soup('table', {'class' : 'spad'})[0].tbody('tr'):
tds = row('td')
print tds[0].string, tds[1].string
# will print date and sunrise
하지만 나 같은 초보자는 코드의이 작품은 내가 위의 예를 해결하는 데 도움이 수있는 방법을 이해할 수 없다 :
예
이었다.
뉴스를 표시하려면 google rss 피드를 사용해야합니다. 연습을 위해서만하지 않는 한, 어떤 것도 webscrape 할 필요가 없습니다. [예] (http://news.google.com/news?pz=1&cf=all&ned=us&hl=en&output=rss) – kreativitea
단지 한 가지 예입니다 ... Google이 아니라 뉴스를 받고 싶습니다. – a1204773