Answer the question
In order to leave comments, you need to log in
Is it possible in BeautifulSoup4 to have "random" access in a tag array after a search using a CSS selector?
When parsing html (websites) in Python-e using the library specified in the subject, I really "stumble" on inconvenient work with tags after
DOWNLOAD_URL = 'http://super-mega-program.org/download.html'
html_page = urlopen(self.DOWNLOAD_URL)
soup = BeautifulSoup(html_page, 'html.parser')
css_selector = 'ТУТ ОЧЕНЬ СЛОЖНЫЙ СТРИНГ'
versions_box = soup.select(css_selector)[0]
p_tags = versions_box.findAll('p', {'class': 'editions'})
ver1 = p_tags[0].i.getText().split()[1]
ver2 = p_tags[5].i.getText().split()[1]
versions_box.p[0].i.text.split()[1]
versions_box.p[5].i.text.split()[1]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question