[Question] I want to scrape a character string surrounded by unique tags!

I'm thinking of extracting only specific elements using CSS selectors from HTML extracted using BeautifulSoup4.

For the (self-made) article scraped this time,

<li class="ramen item" id="syouyu">soy source ramen</li>

Not a tag like

\( 3 \times 4 = 12 \)
$$\int f(x)\ dx = k $$

Some are surrounded by their own tags, such as.

like this

\(  \)
$$  $$

Is there a way to extract only the string enclosed in?

Thank you for your answer.

Recommended Posts

[Question] I want to scrape a character string surrounded by unique tags!
I want to split a character string with hiragana
I tried to generate a random character string
I want to convert an ISO-8601 character string to Japan time
I want to scrape images to learn
I want to specify a file that is not a character string for logrotate, but is it impossible?
I want to print in a comprehension
I want to scrape them all together.
I want to build a Python environment
[Python] How to invert a character string
Mayungo's Python Learning Episode 6: I tried to convert a character string to a number
I want to be cursed by a pretty girl every time I sudo! !!
I want to color a part of an Excel string in Python
I want to easily create a Noise Model
I want to INSERT a DataFrame into MSSQL
I want to create a window in Python
I want to make a game with Python
I don't want to take a coding test
I want to manage systemd by time zone! !!
I want to create a plug-in type implementation
I want to sell Mercari by scraping python
I want to write to a file with Python
I want to upload a Django app to heroku
I tried to automatically generate a character string to be input to Mr. Adjustment with Python
I want to use a network defined by myself in PPO2 of Stable Baselines
[Linux] When you want to search for a specific character string from multiple files
I want to easily implement a timeout in python
I want to iterate a Python generator many times
I want DQN Puniki to hit a home run
100 image processing knocks !! (021-030) I want to take a break ...
I want to give a group_id to a pandas data frame
I want to transition with a button in flask
I want to climb a mountain with reinforcement learning
I want to write in Python! (2) Let's write a test
I want to randomly sample a file in Python
I want to work with a robot in python.
I want to install a package of Php Redis
[Python] I want to make a nested list a tuple
I want to manually create a legend with matplotlib
I want to send a business start email automatically
I want to run a quantum computer with Python
I want to bind a local variable with lambda
I want to create a karaoke sound source by separating instruments and vocals using Python
I want to save the photos sent by LINE to S3
[Python] How to make a list of character strings character by character
I want to make a blog editor with django admin
I want to start a jupyter environment with one command
[Python] I want to get a common set between numpy
I want to start a lot of processes from python
I want to make a click macro with pyautogui (desire)
I want to automatically generate a modern metal band name
NikuGan ~ I want to see a lot of delicious meat! !!
I want to make a click macro with pyautogui (outlook)
[Go] I want to separate endpoints by Read / Write to DB
I want to use a virtual environment with jupyter notebook!
I want to install a package from requirements.txt with poetry
I want to send a message from Python to LINE Bot
Python learning basics ~ How to output (display) a character string? ~
I want to count unique values in arrays and tuples
[Visualization] I want to draw a beautiful graph with Plotly
I want Sphinx to be convenient and used by everyone