I am trying to scrape website data using BS4 but can't write the exact statement to grab the link required. I want to get the link to the searched resource which should be in
<a href="www.speed.org">Speed Org</a>
The code I have written to do this is:
r = re.compile(r'^<a(.)*speed.org(.)*</a>$')
I want the code to display:
<a href="www.speed.org">Speed Org</a>
But it is not giving proper output. Can anyone please fix this code.
Edit:
Someone pointed out that the expression itself is wrong. The correct expression should be: r'^<a(.*)speed.org(.*)</a>$'
Since I was using BS4, it was easier to get the result using soup.
Thanks to all for help. :)