Code Monkey home page Code Monkey logo

borrowbox-scraper's Introduction

Maintainability codecov

BorrowBox-Scraper

Python script to hands-free download all audiobooks on loan from library BorrowBox account.

This script automates the process of downloading books from BorrowBox. It uses Selenium WebDriver to log into BorrowBox, navigate to the "My Loans" page, and download all books.

Requirements

  • Python 3
  • Selenium
  • ChromeDriver
  • WebDriver Manager for Python

Usage

  1. Install the required Python packages:

    pip install selenium webdriver_manager coverage
    
  2. Replace <Library Card Number> and <Pass Code> in the login function with your actual BorrowBox library card number and pass code.

  3. Run the script:

    python scrape_borrowbox_books.py
    

The script will log into BorrowBox, navigate to the "My Loans" page, and download all books. The books will be downloaded to the default download directory of your Chrome browser.

Testing

The script includes a unit tests. To run them, use the following command:

```
python -m unittest test_scrape_borrowbox_books.py
```

borrowbox-scraper's People

Contributors

seanlaidlaw avatar

Stargazers

 avatar

Watchers

 avatar

borrowbox-scraper's Issues

Tool not Working

Getting this error when I run the tool

DevTools listening on ws://127.0.0.1:61539/devtools/browser/45dd5e65-d0e5-4cf4-aef2-16e03f2fa80b
Traceback (most recent call last):
  File "C:\Users\User\Desktop\BorrowBox-Scraper-master\scrape_borrowbox_books.py", line 82, in <module>
    main()
  File "C:\Users\User\Desktop\BorrowBox-Scraper-master\scrape_borrowbox_books.py", line 74, in main
    login(driver, LIBRARY_CARD_NUMBER, PASSCODE)
  File "C:\Users\User\Desktop\BorrowBox-Scraper-master\scrape_borrowbox_books.py", line 45, in login
    login_button.click()
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute
    self.error_handler.check_response(response)
  File "C:\Users\User\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element <button class="button-positive size-large size-fullwidth signin-button" type="submit">...</button> is not clickable at point (509, 430). Other element would receive the click: <div class="text">...</div>
  (Session info: chrome=118.0.5993.89)
Stacktrace:
        GetHandleVerifier [0x008C4DE3+43907]
        (No symbol) [0x00850741]
        (No symbol) [0x007433ED]
        (No symbol) [0x0077B5B1]
        (No symbol) [0x0077A0AF]
        (No symbol) [0x0077869B]
        (No symbol) [0x00777A35]
        (No symbol) [0x0076FF9A]
        (No symbol) [0x00792B5C]
        (No symbol) [0x0076F9D6]
        (No symbol) [0x00792DD4]
        (No symbol) [0x007A55CA]
        (No symbol) [0x00792956]
        (No symbol) [0x0076E17E]
        (No symbol) [0x0076F32D]
        GetHandleVerifier [0x00B75AF9+2865305]
        GetHandleVerifier [0x00BBE78B+3163435]
        GetHandleVerifier [0x00BB8441+3138017]
        GetHandleVerifier [0x0094E0F0+605840]
        (No symbol) [0x0085A64C]
        (No symbol) [0x00856638]
        (No symbol) [0x0085675F]
        (No symbol) [0x00848DB7]
        BaseThreadInitThunk [0x75597BA9+25]
        RtlInitializeExceptionChain [0x76ECBD3B+107]
        RtlClearBits [0x76ECBCBF+191]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.