jmcarp / jmcarp/robobrowser

BS4 warns about explicitly setting the parser to be used

Open
#55 5 comments 1 reaction 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.