BS4 warns about explicitly setting the parser to be used
- Dominant language
- Python
- Stars
- 3.7k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Description
I got the following warning with the latest BeautifulSoup4 and robobrowser from PyPI and Python 3.5
> UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("html.parser"). This usually isn't a problem, but if you run this code on another system, or in a different virtual environment, it may use a different parser and behave differently.
>
> To get rid of this warning, change this:
>
> BeautifulSoup([your markup])
>
> to this:
>
> BeautifulSoup([your markup], "html.parser")
I think robobrowser should specify the parser to get repeatable results
Contributor guide
Research direction
Find the robobrowser code that constructs BeautifulSoup and inspect how the markup is parsed. Make the parser choice explicit as requested, then verify that the warning no longer appears and parsing remains repeatable across environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100