🚀
hrequests
  • Home
  • Installation
  • Simple Usage
    • Attributes
  • Sessions
    • Attributes
  • Concurrent & Lazy Requests
    • Nohup Requests
    • Easy Concurrency
    • Grequests-style Concurrency
  • HTML Parsing
  • Browser Automation
    • Interaction
    • Firefox addons
    • Requests & Responses
    • Closing the page
Powered by GitBook
On this page
  1. Browser Automation

Firefox addons

Import Firefox extensions into a Browser instance

PreviousInteractionNextRequests & Responses

Last updated 6 months ago

Firefox extensions can be easily imported into a browser session. Some potentially useful extensions include:

  • uBlock Origin - Ad & popup blocker (Automatically installed)

  • hektCaptcha - Hcaptcha solver ()

  • FastForward - Bypass & skip link redirects ()

Hrequests only supports Firefox extensions.

Due to limitations in Playwright, Hrequests only supports adding addons to Firefox. Hrequests will throw an error if you attempt to pass the extensions parameter to a Chrome BrowserSession.

Extensions are added with the extensions parameter:

  • This can be an list of absolute paths to unpacked extensions:

    with resp.render(extensions=['C:\\extensions\\hektcaptcha', 'C:\\extensions\\fastforward']):

Note that these need to be unpacked extensions. You can unpack a .xpi file by changing the file extension to .zip and extracting the contents.

Usage example of using a captcha solver:

>>> resp = hrequests.get('https://accounts.hcaptcha.com/demo', browser='firefox')
>>> with resp.render(extensions=['C:\\extensions\\hektcaptcha']) as page:
...     page.awaitSelector('.hcaptcha-success')  # wait for captcha to finish
...     page.click('input[type=submit]')
Download
Download