Answer the question
In order to leave comments, you need to log in
How to get all links to products when parsing?
I'm writing a code that takes all links to products in the store: let's say this one
. I don't know how many products are on the site. How can I get all product links and put them in a list?
Answer the question
In order to leave comments, you need to log in
Find out the class of the a tag and extract the link from there. Example:
Site
code: python code:
<a class="test" href="ссылка">Я ссылка</a>
link = soup.find('a',class_='test').a.get('href')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question