【发布时间】:2019-08-16 14:24:49
【问题描述】:
我正在尝试列出产品页面内的链接。
我有多个链接,我想通过这些链接获取产品页面的链接。
我只是发布单个链接的代码。
r = requests.get("https://funskoolindia.com/products.php?search=9723100")
soup = BeautifulSoup(r.content)
for a_tag in soup.find_all('a', class_='product-bg-panel', href=True):
print('href: ', a_tag['href'])
这是它应该打印的内容:https://funskoolindia.com/product_inner_page.php?product_id=1113
【问题讨论】:
-
可能是this?
标签: python web-scraping beautifulsoup python-requests