Source code of active website?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
hu5b
Posts: 6
Joined: 20 Nov 2017, 12:02

Source code of active website?

20 Nov 2017, 12:03

Is it possible to get the source code of the currently active website in Google Chrome with an AutoHotkey script? Or even easier, a spesific word or number, in this case a PIN code? Since the PIN code is constantly being changed, I cannot download the source code by URL.

Hoping some of you have an answer!
Georgie Munteer

Re: Source code of active website?

20 Nov 2017, 12:06

hu5b wrote:Is it possible to get the source code of the currently active website in Google Chrome with an AutoHotkey script? Or even easier, a spesific word or number, in this case a PIN code? Since the PIN code is constantly being changed, I cannot download the source code by URL.

Hoping some of you have an answer!
does the pin code have a name, id, class name etc?

if yes its an easy grab, post the website
hu5b
Posts: 6
Joined: 20 Nov 2017, 12:02

Re: Source code of active website?

20 Nov 2017, 12:18

Sure, it has a class. This is Kahoot!, and if you know what that is, you will know that it is impossible to get the source code or parts of it by URL.

Image
Georgie Munteer

Re: Source code of active website?

20 Nov 2017, 12:41

if your goal is to load the page enter pin and then click spin and get the username and grab that, its no problem its div 7 and the pin is div 6

i need to know what your plan is and i might be able to test
hu5b
Posts: 6
Joined: 20 Nov 2017, 12:02

Re: Source code of active website?

20 Nov 2017, 13:17

My plan is just to catch the PIN code. Is that possible?
Georgie Munteer

Re: Source code of active website?

20 Nov 2017, 13:30

hu5b wrote:My plan is just to catch the PIN code. Is that possible?
yes, i did a test and it worked

i just dont know what you are doing before u get to that pincode page
hu5b
Posts: 6
Joined: 20 Nov 2017, 12:02

Re: Source code of active website?

20 Nov 2017, 14:00

Do not worry about that. I only want to grab the PIN code from the currently active website when clicking a hotkey.
hu5b
Posts: 6
Joined: 20 Nov 2017, 12:02

Re: Source code of active website?

20 Nov 2017, 14:55

Is it possible to change the value of this ng-class with an AutoHotkeyscript, without seeing it visually?

Image

Image
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Source code of active website?

20 Nov 2017, 18:46

You can consider using Internet Explorer and the COM interface -- essentially a way for a program to instruct what IE should do. There are starter guides in the tutorial section of the forums.

You can consider just doing what a human could. Pull up the source code page. For me, I'd right click the page and select "View Page Source", which I think has some kind of native keyboard shortcut Ctrl+u. I would simply copy that source code to clipboard and extract the PIN with RegEx. I do this for loading up videos on Vikings.com (National Football League team website) because the videos do not play for me in Firefox when they are embedded; I have to extract the source link.

Code: Select all

!-:: ; vikings video viewer
Send ^u ; opens up page source in a new tab
Sleep 2500
Send ^a ; select all the text
Sleep 1000
Clipboard:=""
Send ^c ; put it on the clipboard
ClipWait, 2 ; if it's not on the clipboard in 2 seconds, an error occurred
If ErrorLevel
    {
	MsgBox error
	return
	}
If RegExMatch(clipboard,"<meta itemprop=""contentURL"" content=""(http.*?.mp4)",outputvar) ; finds the first .mp4 link which is the link I want
{
HD:=RegExReplace(outputvar1,"500k","5000k") ; replaces part of the link, "500k" with "5000k" which is a higher definition video
Send ^w ; Closes the tab with the page source in it
Sleep 350
Send ^l ; focuses on the address bar
Sleep 150
SendInput %HD%{Enter} ; navigates me to the direct video link in high quality
}
return
Or, because you say you want to change it, pull up the document inspector or development tools; I just checked Chrome and it's done with Ctrl+Shift+I (capital i). Go to the "Elements" tab and you see the HTML there. Feel free to edit it to submit your own values. Though typically changes done in developer tools are only for you to see; if there's something you want to submit to a website, use the normal fields as a human would normally.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 374 guests