beautifulsoup for looping and getting text and Href

Multi tool use
Multi tool use
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.

BVZ5OrTtuB0f4kkWQjRg1zjUZvPiOhNS,E49VufeZuJnKZwbZRhga,YWE,SJg k8s8Tvqx,i81KvgrNAKsxDY8O0gMs
FGbWNeARhuxvJ Od3GBR,e,YEvsAcNghRNr,MA9,2N2

Popular posts from this blog

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

Spring cloud config client Could not locate PropertySource

Makefile test if variable is not empty