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

Errors Running the example script from the documentation #68

Open
frmsaul opened this issue Nov 6, 2016 · 2 comments
Open

Errors Running the example script from the documentation #68

frmsaul opened this issue Nov 6, 2016 · 2 comments

Comments

@frmsaul
Copy link

frmsaul commented Nov 6, 2016

Hi,

Im trying to run the first script found here:
http://robobrowser.readthedocs.io/en/latest/readme.html
(The one that scrapes Genius.com)

And I'm getting the following error + warning:

/Users/saulfuhrmann/Computers/VirtualEnviroments/TinderHack/lib/python2.7/site-packages/bs4/__init__.py:181: 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.

The code that caused this warning is on line 9 of the file test_robo.py. To get rid of this warning, change code that looks like this:

 BeautifulSoup([your markup])

to this:

 BeautifulSoup([your markup], "html.parser")

  markup_type=markup_type))
Traceback (most recent call last):
  File "test_robo.py", line 11, in <module>
    form['q'].value = 'queen'
TypeError: 'NoneType' object has no attribute '__getitem__'

Im using Python 2.7.10 and my OS is OS X El Capitan (10.11.4)

Am I doing something wrong?
Or did Genius.com just changed their interface and the script is not updated?

-- Saul

@d7laungani
Copy link

I am having the same issue. I don't think it is an issue specifically with genius.com because I am encountering it with other websites too.

@ghost
Copy link

ghost commented Jun 23, 2017

You can pass the parser to beautifulsoup like this:
browser = RoboBrowser(parser='html5lib')

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

2 participants