我想获取下载链接。例如在http://www.brothersoft.com/windows/top-downloads/
所以预期的结果应该是:
List of url:
1. http://www.brothersoft.com/photoscape-64604.html
2. http://www.brothersoft.com/orbit-downloader-54366.html
3. ....
4. ...
till 100.
我试过这段代码:
import urllib
from bs4 import BeautifulSoup
pageFile = urllib.urlopen("http://www.brothersoft.com/windows/top-downloads/")
pageHtml = pageFile.read()
pageFile.close()
soup = BeautifulSoup("".join(pageHtml))
sAll = soup.findAll("a")
for i in range (0,100)
for link in sAll:
print i,link
但它给出了不正确的输出。谢谢