Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RoboBrowser error
#1
This code should go to the mp3 converter page and fill in the form with "just an example". It shows an error, which I don't know how to fix. I tried looking it up but didn't find anything. I would appreciate any kind of help very much. Thanks in advance!

from robobrowser import RoboBrowser


br = RoboBrowser()
br.open("https://ytmp3.cc/")
form = br.get_form()
form['input'] = 'just an example'
br.submit_form(form)
I tried doing the instructions what the error message said, but I don't know how to that exactly. Here is the line in which the error is caused and in which I probably need to pass the additional argument...

    def parsed(self):
        """Lazily parse response content, using HTML parser specified by the
        browser.
        """
        return BeautifulSoup(
            self.response.content,
            features=self.browser.parser
        )
Error:
C:\Users\Valdis\PycharmProjects\automated\venv\lib\site-packages\robobrowser\browser.py:40: 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 40 of the file C:\Users\Valdis\PycharmProjects\automated\venv\lib\site-packages\robobrowser\browser.py. To get rid of this warning, pass the additional argument 'features="html.parser"' to the BeautifulSoup constructor. features=self.browser.parser Traceback (most recent call last): File "C:/Users/Vald/PycharmProjects/automated/youtube.py", line 7, in <module> form['input'] = 'just an example' File "C:\Users\Vald\PycharmProjects\automated\venv\lib\site-packages\robobrowser\forms\form.py", line 216, in __setitem__ self.fields[key].value = value File "C:\Users\Vald\PycharmProjects\automated\venv\lib\site-packages\werkzeug\datastructures.py", line 794, in __getitem__ raise exceptions.BadRequestKeyError(key) werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
Reply


Messages In This Thread
RoboBrowser error - by Pythenx - Mar-23-2019, 09:55 AM
RE: RoboBrowser error - by mlieqo - Mar-23-2019, 12:18 PM
RE: RoboBrowser error - by metulburr - Mar-23-2019, 12:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  robobrowser, answer authentication-challenge after login shiny 0 4,586 Oct-26-2017, 06:48 AM
Last Post: shiny

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020