1
그래서이 맛있는 페이지를 실행하고 일부 링크를 긁어 모으는 파이썬 코드가 있습니다. 추출 방법에는 필요한 내용을 추출하는 마법이 포함되어 있습니다. 그러나 페이지를 하나씩 실행하면 꽤 느려집니다. 파이썬에서이 비동기를 수행하는 방법은 여러 가지 요청을 시작하고 페이지를 병렬로 처리 할 수 있습니까?파이썬 + 기계화 비동기 작업
url= "http://www.delicious.com/search?p=varun"
page = br.open(url)
html = page.read()
soup = BeautifulSoup(html)
extract(soup)
count=1
#Follows regexp match onto consecutive pages
while soup.find ('a', attrs={'class': 'pn next'}):
print "yay"
print count
endOfPage = "false"
try :
page3 = br.follow_link(text_regex="Next")
html3 = page3.read()
soup3 = BeautifulSoup(html3)
extract(soup3)
except:
print "End of Pages"
endOfPage = "true"
if valval == "true":
break
count = count +1
'threading'과'multiprocessing'을 살펴보십시오. – katrielalex
mechanize 및 BeautifulSoup와 잘 작동하는 특정 프레임 워크가 있습니까? – varunsrin