42693/how-to-get-all-anchor-tags-using-beautifulsoup
Hi. I am web scraping and I am trying to find all the anchor tags in the page. I am using the following:
for link in soup.find(‘a’): print (a.text)
But some times the loop fails. Is there any other way to do it?
Yes, you can do it by using the default option by BeautifulSoup.
Try this:
for tag in soup.find_all('a'): print (tag.text)
Try this code: for tag in soup.find_all(True): ...READ MORE
You can use the find_all_next() to do this. Try ...READ MORE
Slicing is basically extracting particular set of ...READ MORE
Hi. Can you please tell me what ...READ MORE
Yes, you can use the headless mode. ...READ MORE
Hey. Refer to the following code: driver.get("link") html = ...READ MORE
I had a similar requirement, this is ...READ MORE
You are missing the square braces. You ...READ MORE
You can specify the class you want ...READ MORE
You can mention both the tags in ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.