https://github.com/realpython/python-web-scraping-examples
https://github.com/realpython/python-web-scraping-examples
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/realpython/python-web-scraping-examples
- Owner: realpython
- Created: 2018-01-17T16:03:20.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-31T18:40:07.000Z (over 7 years ago)
- Last Synced: 2025-05-07T21:03:06.835Z (7 months ago)
- Language: Python
- Size: 3.91 KB
- Stars: 44
- Watchers: 5
- Forks: 22
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python-web-scraping-examples
## BandLeader
The code sample found in `bandleader.py` accompanies [this](hhttps://realpython.com/modern-web-automation-with-python-and-selenium/) post on [realpython.com](https://realpython.com). It introduces the reader to using Python to control headless web browsers. Specifically, `bandleader.py` lets you play music from [bandcamp](https://bandcamp.com) through your Python shell!
To play around with `bandleader.py`, see the [the tutorial](https://realpython.com/modern-web-automation-with-python-and-selenium/) for setting up, then run something like:
```python
>>> from bandleader import BandLeader
>>> bl = BandLeader('myhistory.csv')
>>> bl.play() # should start playing a track
>>> bl.play(3) # plays the third track in the listing
>>> bl.play_next() # advances the track
>>> bl.more_tracks() # see more music to play with
>>> bl.browser.quit() # close the webdriver instance
```