Git Product home page Git Product logo

cointelegraph-scraper's People

Contributors

dub-basu avatar

Watchers

 avatar

cointelegraph-scraper's Issues

Working in ES not in COM

I'm trying to run the code. It works well in the ES (Spanish) version of Cointelegraph but fails on the .COM (English site).

Error:

➜  cointelegraph-scraper (master) ✗ python3 main.py step1 --date 2020-09-14

INFO    : ####### STARTING COINTELEGRAPH SCRAPER #######
INFO    : Starting automated browser window. 
DEBUG   : Found accept button
DEBUG   : Clicked accept button
DEBUG   : Will now load more articles. Date limit: 2020-09-14
CRITICAL: Failed unexpectedly. Check logs.
ERROR   : Exception occured
Traceback (most recent call last):
  File "main.py", line 47, in <module>
    function(date)
  File "main.py", line 11, in step1
    fetch_and_save(date_str, SOURCE_FILE)
  File "/Users/danielpolo/dev/cointelegraph-scraper/scraper.py", line 17, in fetch_and_save
    load_more(driver, date_string)
  File "/Users/danielpolo/dev/cointelegraph-scraper/scraper.py", line 64, in load_more
    last_article_date = string_to_date(get_last_date(driver))
  File "/Users/danielpolo/dev/cointelegraph-scraper/scraper.py", line 41, in get_last_date
    while not is_url_valid(URL + articles_tags[last_index].header.a['href']):
  File "/usr/local/lib/python3.8/site-packages/bs4/element.py", line 1368, in __getitem__
    return self.attrs[key]
KeyError: 'href'

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.