I have been working on a project to pull specific href links from a site. Everything is working but I also want to be able to pull only specific data from href link. I haven’t been able to figure that part out. Here is the output I’m trying to get the output to look like this Answer Use regex Output
Tag: href
Python bs4: select specific links in soup
I know similar questions were asked before but no adaptation of other solutions yielded the desired result. Suppose a bs4 soup contains many elements like the one below: How can I extract the link in the very first line (href=”extract_this_link”) for all elements in the soup and store them in a list? Any help is greatly appreciated! Answer