Skip to content

KennethTrinh/webscraping-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Webscraping Template

Use when you need to scrape something very fast.

Getting started

python3 -m venv env
source dev.sh
pip install -r requirements.txt

Debug mode

Typing d in the terminal will run the script in debug mode and dump everything into python interactive shell, where you can inspect the variables and objects. Press q to quit the interactive shell.

Running the script

Typing r in the terminal will run the script.

Helper functions

write(data, filename='test.html') - writes response data to a file with the given filename. The default filename is test.html. You can change it to whatever you want.

dfs(data, match_fn) - performs a depth-first search on a nested dictionary or list. It takes a function as an argument that returns True if the data matches the condition you are looking for. Returns a tuple of matching data and the path to the matching data.

TODO

  • Add nested attributes class for converting dicts to objects

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published