Найти - Пользователи
Полная версия: Парсер URL на Python
Начало » Python для новичков » Парсер URL на Python
1
xOxXakerxOx
Как спарсить URL со страницы?
 import requests
import bs4
url = 'https://www.hltv.org/matches/2326984/movistar-riders-vs-tempo-storm-ggbet-shuffle-closed-qualifier'
s = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})
b = bs4.BeautifulSoup(s.text, "html.parser")
team1 = b.select('.player')
t1 = team1[0].getText
print(t1)
Romissevd
 import requests
import bs4
url = 'https://www.hltv.org/matches/2326984/movistar-riders-vs-tempo-storm-ggbet-shuffle-closed-qualifier'
s = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})
b = bs4.BeautifulSoup(s.text, "html.parser")
team1 = b.select_one('.player > a')
print(team1['href'])
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB