3
我想从www.flipkart.com刮去所有的手机。现在,我想要做的是,我可以从这里刮所有的手机。现在刮掉Flipkart.com的所有手机
http://www.flipkart.com/mobiles/pr?p[]=sort%3Dprice_asc&sid=tyy%2C4io&layout=grid
,问题是,在这个网站,我必须按“表现出更多的成果”查看更多结果。但是,我怎样才能使用代码做到这一点?我在Python中使用BeautifulSoup包。
我的代码至今:
import bs4
import re
import urllib2
import sys
link = 'http://www.flipkart.com/mobiles/pr?p[]=sort%3Dprice_asc&sid=tyy%2C4io&layout=grid'
response = urllib2.urlopen(link)
thePage = response.read()
soup = bs4.BeautifulSoup(thePage)
allMobiles = soup.find('div', attrs={'id': 'products'})
我只得到输出的第一页?我如何访问其他页面?