F
F
fire_engel2020-04-05 15:13:01
HTML
fire_engel, 2020-04-05 15:13:01

Python requests: how to set a mask in find_all?

Recently I started to get acquainted with web scraping, and almost immediately a question arose:
I have elements that have the class "foobar node_101", "foobar node_102", "foobar node_103" and so on. I'm trying to customize the mask but "foobar *" doesn't help. Please help me with this, the mask should look like "foobar node_???".

page = requests.get(url)
soup = BeautifulSoup(page.content, 'html.parser')
results = soup.find_all(class_='foobar *')

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
RAX7, 2019-09-30
@Albert1991

Inkscape generated some stuffing, the clipping masks moved off the filled outlines, so nothing is visible. Keep the corrected version: https://codepen.io/RAX7/pen/pozXyyQ

D
Dr. Bacon, 2020-04-05
@fire_engel

Read the rules, the code cannot be inserted as a picture, and the answer to your question is in the docks https://www.crummy.com/software/BeautifulSoup/bs4/... learn to read them first, and then ask a question here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question