Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BS4 warns about explicitly setting the parser to be used #55

Open
ztane opened this issue Oct 29, 2015 · 5 comments
Open

BS4 warns about explicitly setting the parser to be used #55

ztane opened this issue Oct 29, 2015 · 5 comments

Comments

@ztane
Copy link

ztane commented Oct 29, 2015

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

@BrendanMartin
Copy link

I have the same problem. A very annoying message to see every time I run.

@pkillnine
Copy link

You can specify the parser when instantiating the Browser object (the value to specify is "parser").

I think a better solution is to make this clear in the documentation.

@fananimi
Copy link

fananimi commented Aug 5, 2016

Hi, I also have some problem, is someone here have a solution ?

@pkillnine
Copy link

@fananimi See my comment above yours

@mrsxypants
Copy link

further clarification for @sfgasdfsafggfgg comment:

browser = RoboBrowser(parser='html.parser')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants