Ruby on Rails
Thursday, December 27, 2018
On Thursday, December 27, 2018 at 1:38:34 PM UTC-5, Walter Lee Davis wrote:
> On Dec 26, 2018, at 5:12 PM, fugee ohu <fuge...@gmail.com> wrote:
>
>
>
> On Wednesday, December 26, 2018 at 4:41:53 AM UTC-5, Colin Law wrote:
> On Tue, 25 Dec 2018 at 20:19, fugee ohu <fuge...@gmail.com> wrote:
> >
> > yes, there's scripts running and when i click response i see the data i'm looking for The script names are https urls ending in .do? with a lot of query string data, so what should I do?
>
> Don't worry about scripts for the moment, look for urls that provide
> data, probably xml or json. Surely you have used this yourself in
> your rails apps using AJAX.
>
> Colin
>
> Trying now to use Capybara::DSL but when I run visit <'url'> from within rails console rails complains no such route
You are missing the entire point of what Colin is telling you. From what you describe, you are trying to do the following:
1. Download the JS from a data source.
2. Reconstruct the DOM using a JS driver like Chrome or PhantomJS.
3. Parse the DOM with Nokogiri or similar
4. Use the data you gather
Colin is recommending that you download the JS and parse it directly for the data you require. This will not require a driver of any kind, you are simply reading the data as JSON, which is a valid interchange format that Ruby can read directly using the standard library.
Walter
The JSON returned is a string How do I parse it into an object?
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/75ca04d0-8fdd-4018-85dc-0acb2d3b4a30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment