Utils to slurp stuff
Project description
lv
Utils to slurp stuff
To install: pip install lv
Overview
The lv package provides utilities to automate web interactions, particularly for logging into websites and downloading content. The primary functionality is encapsulated in the slurp_with_login_and_pwd function. This function uses the mechanize library to handle web requests, manage cookies, and parse forms, allowing users to log into sites and access resources that require authentication.
Functionality
slurp_with_login_and_pwd
This function automates the process of:
- Opening a web page with a login form (currently hardcoded to Yahoo's login page).
- Filling out and submitting the login form with user credentials.
- Navigating to a subsequent URL (currently hardcoded to a specific Coursera lecture video) after logging in.
- Downloading content from the final URL.
The function uses mechanize.Browser to simulate a web browser, which handles cookies and user-agent headers to maintain session and appear as a regular browser to web services.
Usage
Basic Example
Below is an example of how you might use the slurp_with_login_and_pwd function within a Python script. Note that you will need to replace 'yahoo-user-id' and 'password' with your actual Yahoo credentials, and the URL with the resource you wish to access after logging in.
from lv import slurp_with_login_and_pwd
# Ensure you replace the credentials and URL with your specific details
slurp_with_login_and_pwd()
Important Notes
- The function is currently tailored specifically for Yahoo and a Coursera course video. To use it for other websites or resources, modifications to the function are required.
- Ensure that your use of this function complies with the terms of service of the website you are interacting with.
Dependencies
mechanize: Used for handling HTTP requests, forms, cookies, and more.
Installation
To use the lv package, you will need to install the required dependencies:
pip install mechanize
Then, you can install the lv package itself:
pip install lv
Disclaimer
This tool is intended for educational and legitimate purposes only. Ensure that you have the right to access and download content from the website, and always respect the terms of service of the website.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lv-0.0.6.tar.gz.
File metadata
- Download URL: lv-0.0.6.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df985f0356ae46eee328d08ac408e7de554b201581869760410010a44e944488
|
|
| MD5 |
d0612d4916319f13946207bb1bf2665c
|
|
| BLAKE2b-256 |
ce906bd4069013a025a57892cad6cee025fe186f59ab0ab39168cd3b95e06de2
|
File details
Details for the file lv-0.0.6-py3-none-any.whl.
File metadata
- Download URL: lv-0.0.6-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9135564704b4b95e0cffe9ece43bab1b16d36ae2f87a56018af700bbdefab62f
|
|
| MD5 |
b63fac14a679483742596f9bdae33bdd
|
|
| BLAKE2b-256 |
2c8dde7eb3ade254d2022a6d609c588c0cde60962ee71782bd62fde9ecac81cf
|