Answer the question
In order to leave comments, you need to log in
How to parse href links???
Need only href links? how to implement it with
import requests
from bs4 import BeautifulSoup as BS
r = requests.get('https://www.site/news/')
html = BS(r.content, 'html.parser')
for el in html.select('.anons-readmore'):
url_more = el.select('a')
print(url_more)
Answer the question
In order to leave comments, you need to log in
for el in html.select('.anons-readmore'):
url_more = el.select_one('a').get('href')
print(url_more)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question