beautifulsoup for looping and getting text and Href

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


beautifulsoup for looping and getting text and Href



Im in a bit of a quinch here:



its an ASP site which is really messy that I am trying to get data from:



Im trying to use a FOR loop to get an href and the text of all the rows of the 4th table that is on the site, so I first did:


table = soup.findAll('table')[3]



Then from this table I need to get all text inside the tags and the href's of the inside.



i tried something like this:


for product in table.findAll('tbody'):
product_title = product.find('tr').text
product_link = product.find('a')['href']
print (product_title, product_link)



But I get nothing in return...



:(





Can you show a print of product?
– Rakesh
7 mins ago


product





What does your HTML document look like?
– ggorlen
1 min ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

C++ virtual function: Base class function is called instead of derived