Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.

Incompatible with crystal v1.1.1 #8

Open
AmitPress opened this issue Aug 9, 2021 · 2 comments
Open

Incompatible with crystal v1.1.1 #8

AmitPress opened this issue Aug 9, 2021 · 2 comments

Comments

@AmitPress
Copy link

The project uses now incompatible apis of crystal v0.33.0 like URI.full_path and others which are deprecated in crystal v1.1.1, that's why the library become unusable with the latest versions. A rewrite for v1.1.1 must needed.

@frnco
Copy link

frnco commented Jun 27, 2022

This is actually incompatible with Crystal 1.0.0 and anything above that, since it relies on URI's instance method full_path which was removed on 1.0.0. This is probably not the only cause for the incompatibility, and seeing as this project had no updates in a couple years, using something else seems to be the best choice, rather than patching this up.

A seemingly good alternative is Mechanize. I'm just making this switch on a slightly older personal project I came back to, and I have no affiliation whatsoever to the project, I just thought it might be nice to make it easier for anyone coming here to find an alternative.

Be warned, though, Mechanize doesn't look like the most regularly-maintained project either. That said, as far as my needs took me, it ran fine on Crystal 1.4.1 (The most recent version I have installed), and my Arachnid code needed only minimal adjustments to run with it, to give the specifics for my specific case, which please keep in mind is very basic:

  • Arachnid::Agent.new became simply Mechanize.new
  • The ugly-nested-blocks below:
    agent.site(url) do
      agent.on_html do |page| 
        ...
      end
    end
    
    became simply page = agent.get url

And that was it. I already used .css to select stuff, using string css-selectors, which also works in Mechanize, so it was even easier than I expected to make the switch. This is anecdotal evidence, but it's all I can offer, and I believe it's better than nothing, at least for anyone looking for an alternative who has absolutely no information on the alternatives.

Also, I'd like to take the opportunity to thank @watzon for Arachnid and Marionette. I did use Arachnid in quite a few personal projects, there are still a bunch of binaries I sometimes use that were built with it, and the same goes for Marionette, so, thank you. Perhaps you could add a note to the readme about Arachnid being incompatible with recent Crystal versions, with link(s) to one or more alternatives.

Again, thanks for sharing this Chris!

@watzon
Copy link
Owner

watzon commented Jun 27, 2022

Yeah I haven't had the time or desire to really work on this project anymore as of late. I'd be happy to add Mechanize to the README and archive this project.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants