Coder Social home page Coder Social logo

financial_web_crawler's People

Contributors

dependabot[bot] avatar xicocaio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

financial_web_crawler's Issues

API requests yielding errors, primarily due to high number of elements per request

Sometimes the WSJ API returns an HTML error, which is mostly related to the number of elements per request. Then, we get the following error:

ERROR: Spider error processing <POST https://api.wsj.net/api/slinger/headlines/806/2250>
KeyError: 'Summary'

However, these errors appear mostly when the system processes all available news and so it should be treated differently. So this error seems to be caused by an empty list os news being retrieved, and so the API returns an HTML instead of an empty json.

The desired behavior is:

  • The system should try decreasing the number of elements per request to distinguish from the situation where there is no more available news
  • The system should go to the next stock of the list if it is verified there is no more news to retrieve
  • The system must not restart when this error happens

Move the main for loop of stocks to spider

It seems scrapy expects all loops on the same website are self-contained. So, instead of handling the stock iteration inside the main, we should change the spider so that it handles the error inside the spider and the moves to the next stock. This solution for this issue is related to #1, and should be executed simultaneously.

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.