pwb get element help Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

pwb get element help

04 Dec 2017, 16:32

Any ideas how can I get the link of first song on the page?

Code: Select all

ypwb := ComObjCreate("InternetExplorer.Application")
ypwb.Visible := true
ypwb.Navigate("https://www.youtube.com/results?search_query=Song")
while ypwb.busy or ypwb.ReadyState !=4
	sleep, 10

URL := pwb.document.getElementsByClassName("yt-uix-tile-link yt-ui-ellipsis yt-ui-ellipsis-2 yt-uix-sessionlink      spf-link ").item(0).href
MsgBox % URL
User avatar
Xtra
Posts: 2750
Joined: 02 Oct 2015, 12:15

Re: pwb get element help  Topic is solved

04 Dec 2017, 16:57

Try changing pwb to ypwb like the rest of your code.
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: pwb get element help

04 Dec 2017, 16:59

Hi HIAC,

Here's a solution

Code: Select all

document.getElementById("contents").getElementsByTagName("a")[1].href
my scripts
A_AhkUser
Posts: 1147
Joined: 06 Mar 2017, 16:18
Location: France
Contact:

Re: pwb get element help

04 Dec 2017, 17:00

Xtra wrote:Try changing pwb to ypwb like the rest of your code.
I didn't noticed the typo... :facepalm:
my scripts
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Re: pwb get element help

04 Dec 2017, 17:25

God damn!
Thank you both, solved.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 236 guests