我希望获得特定类别每个应用的Playstore链接。
这是我尝试过的方法:
r = br.open("https://play.google.com/store/apps/category/ART_AND_DESIGN/collection/topselling_free")
html = r.read()
soup = bsoup(html)
urlslist = soup.findAll("a", { "class" : "card-click-target" })
fo = open('url.txt', 'w')
for url in urlslist:
print "".join(["https://play.google.com",url])
fo.write("".join(["https://play.google.com",url])+"\n")
fo.close()
但是它没有返回任何东西。urlslist也没有被填充。我尝试使用不同的标签和类,例如soup.findAll("div", { "class" : "title" })
,但是那也返回一个空数组。
请给予建议。提前感谢您。
html = r.read()
会给你页面源代码吗?因为我在这里使用了requests
库进行测试。 - zamirrequests.get(url).text
将会给你源代码。 - zamir