GithubHelp home page GithubHelp logo

brutuscat / medusa Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chriskite/anemone

16.0 16.0 9.0 327 KB

- THIS IS AN OLD FORK - Checkout Medusa Crawler gem instead "medusa-crawler"

Home Page: https://github.com/brutuscat/medusa-crawler

License: MIT License

Ruby 100.00%
crawler forked multithreading openuri robots-txt ruby scrapper spider

medusa's People

Contributors

bernd avatar brownbeagle avatar brutuscat avatar chriskite avatar donv avatar lpradovera avatar mislav avatar mothonmars avatar nehhen avatar paresharma avatar rb2k avatar skojin avatar spk avatar tilsammans avatar zirconcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

medusa's Issues

some URL fragments are being retained & encoded

Medua's regex to identify anchor fragments is fairly strict: /#[a-zA-Z0-9_-]*$/

As a result, fragments with non-alphanumeric characters are being retained and encoded. Example:

Medusa.crawl('https://www.usbr.gov/library/glossary/', depth_limit: 0, discard_page_bodies: true) do |medusa|
  medusa.on_every_page do |page|
    puts page.links.map(&:to_s).select{ |link| /%23/ === link }
  end
end

Result:
https://www.usbr.gov/library/glossary/%23crest%20elevation
https://www.usbr.gov/library/glossary/%23prestressed%20dam
https://www.usbr.gov/library/glossary/%23modifiedhomogeneousearthfilldam%3Emodified%20homogeneous%0D%0Aearthfill%20dam%3C/a%3E,%20%3Ca%20href=
https://www.usbr.gov/library/glossary/%23o&m

PR to come.

Robots.txt not respected if first page is redirected

If you set Medusa to crawl http://www.foo.com, which is redirected to https://www.foo.com, Medusa will successfully crawl the site, but it will not respects robots.txt. This appears to be happening because Robotex will attempt pull the robots.txt file from http://www.foo.com/robots.txt without following the redirection. This results in no robot rules for the domain www.foo.com.

Example:
In https://www.yelp.com/robots.txt:
Disallow: /biz_link

> robotex = Robotex.new "My User Agent"

> robotex.allowed?("https://www.yelp.com/biz_link")
false

> robotex = Robotex.new "My User Agent"

> robotex.allowed?("http://www.yelp.com/biz_link")
true

I'd be happy to put in a PR to resolve this, but I've been going back and forth about whether the fix should be done in Robotex or Medusa.

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.