B
B
Brutus12020-07-27 10:15:11
Python
Brutus1, 2020-07-27 10:15:11

How to extract the href from the a tag?

How from this

<a class="card" href="/index.php?r=cards/cards&amp;variant=1&amp;token=0bd8299d2d0141dbf78c188661bde746"></a>


do it:
url = /index.php?r=cards/cards&amp;variant=1&amp;token=0bd8299d2d0141dbf78c188661bde746

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-07-27
@Brutus1

Just like in a dictionary.

tag['href']
tag.get('href')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question