This length of this class is not being returned Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

This length of this class is not being returned

29 Jun 2020, 05:16

I checked manually by visit the page and know there are 2 objects for this class. Nothing works related to using JS to get data from the response text (unless I use regex obviously), does anyone see where things are breaking?

Code: Select all

url :="https://chrome.google.com/webstore/detail/ferrari-wallpaper-hd-cust/facihnceaoboeoembnbmdlecmkpioacc?hl=en"
HTTP := ComObjCreate("WinHttp.WinHttpRequest.5.1")
HTTP.Open("GET", url, true)
HTTP.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
HTTP.Send()
HTTP.WaitForResponse()
respo := http.ResponseText
;msgbox, % respo
html := ComObjCreate("HTMLfile")
html.write("<meta http-equiv=""X-UA-Compatible"" content=""IE=9"">")
html.designMode := "on"
html.write(respo)
msgbox, % html.getElementsByClassName("C-b-p-rc-D-R").length ;;[0].innerText

ExitApp
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: This length of this class is not being returned

29 Jun 2020, 22:23

if anyone has any ideas please post. :thumbup:
teadrinker
Posts: 4349
Joined: 29 Mar 2015, 09:41
Contact:

Re: This length of this class is not being returned

30 Jun 2020, 06:30

Some elements are loaded after loading the page by a javascript.
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: This length of this class is not being returned

30 Jun 2020, 06:43

teadrinker wrote:
30 Jun 2020, 06:30
Some elements are loaded after loading the page by a javascript.
But even if I save the entire page to a text file and I open the file manually and I see the class is there and then try to use AHK to get the info, it shows nothing. Is the problem maybe because there is a iframe there? I also did a regex test and the data is there.

Thanks for trying to help
Last edited by AHKStudent on 30 Jun 2020, 06:55, edited 1 time in total.
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: This length of this class is not being returned  Topic is solved

30 Jun 2020, 06:54

Code: Select all

respo := StrReplace(http.ResponseText, "<noscript>")
AHKStudent
Posts: 1472
Joined: 05 May 2018, 12:23

Re: This length of this class is not being returned

30 Jun 2020, 09:00

malcev wrote:
30 Jun 2020, 06:54

Code: Select all

respo := StrReplace(http.ResponseText, "<noscript>")
:thumbup: :thumbup: :thumbup: Works like a charm thanks

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], Spelth and 151 guests