1
<a class="button button-mini" href="www.example-link.com.c"><b>TEXT</b></a>

I'm creating Python parser, and i need to get link from this tag. I tried this, but result was "None":

link = table.find_all('td')[1].a.href
link = table.find_all('td')[1].a.link

Using Beautiful Soup 4 & Python 3.5

1
  • Try a.get('href') Commented Jul 18, 2016 at 10:31

1 Answer 1

1

I think that it's a pretty simple question where you are just missing parameters. It should be written as:

link = table.find_all('td')[1].a.get('href')

Edit note

Just noticed after answering that a user has responded to you as comment... Don't want to steal any credits.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.