Skip to main content

access `fetch()` with selenium!

Project description

selenium-fetch

A simple module that lets you access the fetch API with selenium!

Why do I make this? just annoyed with cloudflare. It works best with undetected-chromedriver.

Installation

pip install selenium-fetch undetected-chromedriver

Example

from undetected_chromedriver import Chrome
from selenium_fetch import fetch, Options, get_browser_user_agent

LOGIN_PAGE_URL = "https://smekdong.com/login"
LOGIN_API_URL = "https://smekdong.com/api/login"
driver = Chrome(headless=False)
driver.get(LOGIN_PAGE_URL)
post_data = {
    'username': 'blaabla',
    'password': 'xxxx'
}
headers = {
    "user-agent": get_browser_user_agent(driver),
    'origin': 'https://smekdong.com',
    'referer': 'https://smekdong.com/',
}
options = Options(method="POST", headers=headers, body=post_data)
response = fetch(driver, LOGIN_API_URL, options)
print("Response:", response)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

selenium_fetch-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

selenium_fetch-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file selenium_fetch-0.1.1.tar.gz.

File metadata

  • Download URL: selenium_fetch-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.11 Darwin/21.6.0

File hashes

Hashes for selenium_fetch-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e3c6005395d202986ac9235e9149e1dca1aad3ec07cc65971a673bd0a0ec3092
MD5 d88df14b39942ed60c5e37644275100e
BLAKE2b-256 00ab13bb7bd2d90ca0405e5cc6329f58c70a7267d00e732ac71651ee99789cbe

See more details on using hashes here.

File details

Details for the file selenium_fetch-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: selenium_fetch-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.11 Darwin/21.6.0

File hashes

Hashes for selenium_fetch-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b8551babd5d4648558a726b56e355016884aa2b545597f54c38ad144c0e873
MD5 5e9f3d7eb0ef8a6c2410beeb7cb05ab5
BLAKE2b-256 76c1dfdd3474d3d7b96bc2219eb69e6c2f716108677f9d2171c9ba7174df5b29

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page