web scraping - Python 3.5 Beautiful soup 4 Error UserWarning: No parser was explicitly specified -


i try use beautifulsoup 4. after installed, there error , can't fix "soup= beautifulsoup(html)"

when use following code:

from bs4 import beautifulsoup   soup = beautifulsoup(html) 

it shows error:

//anaconda/lib/python3.5/site-packages/bs4/__init__.py:166: userwarning: no parser explicitly specified, i'm using best available html parser system ("lxml"). isn't problem, if run code on system, or in different virtual environment, may use different parser , behave differently.  rid of warning, change this:   beautifulsoup([your markup])  this:    beautifulsoup([your markup], "lxml")    markup_type=markup_type)) traceback (most recent call last):     file "<ipython-input-13-d4b16f497b1d>", line 1, in <module> runfile('/users/beckswu/desktop/coursera/using python access web data/class 2.py', wdir='/users/beckswu/desktop/coursera/using python access web data')     file "//anaconda/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 699, in runfile execfile(filename, namespace)     file "//anaconda/lib/python3.5/site-packages/spyderlib/widgets/externalshell/sitecustomize.py", line 88, in execfile exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)     file "/users/beckswu/desktop/coursera/using python access web data/class 2.py", line 37, in <module> soup = beautifulsoup(html)     file "//anaconda/lib/python3.5/site-packages/bs4/__init__.py", line 212, in __init__ markup, from_encoding, exclude_encodings=exclude_encodings)):     file "//anaconda/lib/python3.5/site-packages/bs4/builder/_lxml.py", line 108, in prepare_markup markup, try_encodings, is_html, exclude_encodings)  typeerror: __init__() takes 2 4 positional arguments 5 given 

then change code

from bs4 import beautifulsoup   soup = beautifulsoup(html,"lxml") markup_type=markup_type)) 

it shows error

    markup_type=markup_type))                        ^ syntaxerror: invalid syntax 

how can fix that? appreciate anyone's help.

instead of html,you need pass text file of html below

from bs4 import beautifulsoup request = requests.get("http://www.flipkart.com/search").text soup = beautifulsoup(request) 

hope helps :)