<div class="ui-box product-description-main" id="j-product-description"> <div class="ui-box-title">Product Description</div> <div class="ui-box-body"> <div class="description-content" data-role="description" data-spm="1000023"> <div class="loading32"></div> </div> </div> </div>
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/12b65225-60e5-4fe3-80a7-9ebb8013f312%40googlegroups.com.
On Thu, 27 Dec 2018 at 22:00, fugee ohu <fuge...@gmail.com> wrote:
>
>
>
> On Thursday, December 27, 2018 at 4:04:55 PM UTC-5, Hassan Schroeder wrote:
>>
>> On Thu, Dec 27, 2018 at 12:24 PM fugee ohu <fuge...@gmail.com> wrote:
>>
>> > So then how
>>
>> 1) choose HTTP client
>> 2) send request
>> 3) parse response
>>
>> --
>> Hassan Schroeder ------------------------ hassan.s...@gmail.com
>> twitter: @hassan
>> Consulting Availability : Silicon Valley or remote
>
>
> Net::HTTP.get(<url>) returns a string
> data = JSON.parse(response)
> JSON::ParserError: 765: unexpected token at 'jQuery18300000644047005491_1545822229753({"success":true,"code":0,"results":[{"productIdes"
Forget about how to parse it for the moment. Is the data you want in
the response?
Colin
The ui-box class would indicate that it is a react component: https://github.com/segmentio/ui-boxReact components are run client-side, meaning the text you are looking for is inserted into the document after the page runs <script> tags. I would take a look at the Sources tab in chrome, you can find all the loaded scripts there.On Wed, Nov 7, 2018 at 10:17 AM fugee ohu <fuge...@gmail.com> wrote:
On Wednesday, November 7, 2018 at 11:01:32 AM UTC-5, Colin Law wrote:I should think that javascript is involved. I am sure you asked a
similar question before when you were trying to scrape a website and
couldn't find the text in the html.
Colin
On Wed, 7 Nov 2018 at 15:35, fugee ohu <fuge...@gmail.com> wrote:
>
> I'm not very good with the consoles in chrome and firefox but I couldn't find the text I was looking for in source even though it's displayed as text seemingly, the cursur changes to a vertical line on mouse-over I found this html below in the source How does this html create the text that displays?
>
> <div class="ui-box product-description-main" id="j-product-description">
> <div class="ui-box-title">Product Description</div>
> <div class="ui-box-body">
>
> <div class="description-content" data-role="description" data-spm="1000023">
> <div class="loading32"></div>
> </div>
>
> </div>
> </div>
>
> --
> 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-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/8e0eb26a-517a-4216-bb9c-8bd05e4412a5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Yes, within that context, javascript, how does it happen that the text I'm viewing in the browser isn't visible in source?
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/12b65225-60e5-4fe3-80a7-9ebb8013f312%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm not very good with the consoles in chrome and firefox but I couldn't find the text I was looking for in source even though it's displayed as text seemingly, the cursur changes to a vertical line on mouse-over I found this html below in the source How does this html create the text that displays?<div class="ui-box product-description-main" id="j-product-description"> <div class="ui-box-title">Product Description</div> <div class="ui-box-body"> <div class="description-content" data-role="description" data-spm="1000023"> <div class="loading32"></div> </div> </div> </div>
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/007843ea-8793-46fb-ab40-bf63e55fb2bf%40googlegroups.com.
I changed my code and now getting a text/html content type response Not sure what I'm doing I commented out my previous creation of http object and used an inline syntax that's part of the creation of res objectrequire "net/http"require "uri"url = URI.parse("https://www.ali<notshown>.com/item/Robotic-Vacuum-Cleaner-Proscenic-790T-Vacuum-Mop-Sweep-3-in-1-Cleaner-for-Pet-Hair-Wifi/32840149410.html?spm=2114.search0104.3.1.24d566b6GAD2uI&ws_ab_test=searchweb0_0,searchweb201602_1_10065_10068_10130_10890_10547_319_10546_317_10548_5730311_10545_10696_453_10084_454_10083_5729211_10618_10307_538_537_536_10059_10884_10887_100031_321_322_10103-10890,searchweb201603_51,ppcSwitch_0&algo_expid=99dc32b9-d1ce-4020-8bec-624c18225f44-0&algo_pvid=99dc32b9-d1ce-4020-8bec-624c18225f44")#http = Net::HTTP.new(url.host, url.port)#http.use_ssl = truereq = Net::HTTP::Get.new urlres = Net::HTTP.start(url.host, url.port, :use_ssl => url.scheme == 'https') {|http| http.request req}puts res.body
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/638bfc50-c217-4a52-892e-a3302b537f47%40googlegroups.com.
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLt0offRa0OgDQEhJJnmiEpgQodxw5bHmOGBzb%2BRN%3D1f6A%40mail.gmail.com.
--
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-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9783f3a7-4739-4de9-8a44-a4c4900d0c8c%40googlegroups.com.