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

Warning from BeautifulSoup #1

Open
srghma opened this issue Sep 29, 2015 · 12 comments
Open

Warning from BeautifulSoup #1

srghma opened this issue Sep 29, 2015 · 12 comments

Comments

@srghma
Copy link

srghma commented Sep 29, 2015

/usr/lib/python3.4/site-packages/bs4/__init__.py:166: UserWarning: No parser was explicitly specified, so I'm using the best available HTML parser for this system ("lxml"). 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], "lxml")

  markup_type=markup_type))```
@kkyaw88
Copy link

kkyaw88 commented Nov 23, 2015

I also have the same problem. Not find out yet the solution.

@wenbowang
Copy link

I just came across the same error and here is my solution on MacOS:
edit the file '/Library/Python/2.7/site-packages/PyDictionary/utils.py'
change 'return BeautifulSoup(requests.get(url).text)'
to 'return BeautifulSoup(requests.get(url).text, 'html.parser')'.

Then, it will work. I got inspired by this link.

@yang1992
Copy link

BeautifulSoup(html_doc,"lxml")

@geekpradd
Copy link
Owner

Can anyone open up a pull request with the above fixed?
I'll merge it. I'm currently not participating in open source development (doing algorithmic competitive programming instead) so any help would be appreciated.

@bunchesofdonald
Copy link
Contributor

I created a PR to fix this here: #3

@srghma
Copy link
Author

srghma commented Jun 8, 2016

@geekpradd , as maintainer can you upload fixed version to pip and I'll close issue?

@AndreiRegiani
Copy link

@geekpradd , as maintainer can you upload fixed version to pip and I'll close issue?

+1 would be nice to have pip version updated, currently has the annoying warning...

@renweibo
Copy link

renweibo commented May 7, 2017

+1 for this fix

@srghma
Copy link
Author

srghma commented May 7, 2017

@renweibo , you can use @bunchesofdonald fork with pip directly

@renweibo
Copy link

renweibo commented May 7, 2017

@BjornMelgaard Thanks for the reply. Installing directly from github branch failed for there is no setup.py as a normal pypi package has.

It's better to update pypi also.

Even I manually update the util.py with the patch, it still failed in python 3.6 environment.

@srghma
Copy link
Author

srghma commented May 7, 2017

@renweibo lol

@timabbott
Copy link

We had the same problem with a missing setup.py. @geekpradd can you do a release in pypi with this fix? It should be trivial.

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

9 participants