how to get the page source by just one click?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

how to get the page source by just one click?

22 Jun 2017, 05:45

Dear All,

There is a pop-up page on a new window.

I know alt+d can get the URL from a browser. (Browser : Chrome)
But alt+d is not working on the new window.
( I tested alt+d, then ctrl+c has no data on the new window. )

I just thought when I execute the ahk script.

The script will do like this;
1) send !D -> highlight an url
2) send ^C -> copy the url
3) urldownload the url from #1
4) my final purpose of this script is getting some part of the URL, the page source has the data that I want to get.

But as I told, the first step was not working on the new window.
Do you have any idea?

Thank you for your reading always!
Guest

Re: how to get the page source by just one click?

25 Jun 2017, 04:33

Depending on what you need this may work:

How about ^a ^c (select all, copy text) IN the new window, it should copy the text + html formatting so both are now in memory. You can access the HTML part using WinClip() https://autohotkey.com/boards/viewtopic.php?f=6&t=29314
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: how to get the page source by just one click?

25 Jun 2017, 07:16

I just want to clarify for you that when you Send a capital letter, shift is implied. Send +d is the same as Send D. This is also true with other modifiers. Send !+d is the same as Send !D. If you had manually tested the alt+d on this pop up window, then this isn't necessarily the problem that's holding you back, but it could be another one you'd have as you pieced together a working script.
tyyi
Posts: 84
Joined: 23 Dec 2015, 08:51

Re: how to get the page source by just one click?

04 Jul 2017, 08:23

Guest wrote:Depending on what you need this may work:

How about ^a ^c (select all, copy text) IN the new window, it should copy the text + html formatting so both are now in memory. You can access the HTML part using WinClip() https://autohotkey.com/boards/viewtopic.php?f=6&t=29314
Thank you for your reply.

I will check your suggestion, but I don't understand that Select All can get text + html in the same time.
I guessed Select All and Copy just copied text from the new window.

Anyway, really thank you for your interesting and reply again.
Guest

Re: how to get the page source by just one click?

04 Jul 2017, 15:17

When you copy something from a web page it also copies the formatting such as bold, lists, tables, images etc. That formatting is of course in HTML format and you will see when you paste in Word for example bold, italics, lists etc are preserved. The clipboard can hold various formats including HTML - see https://en.wikipedia.org/wiki/Clipboard ... ta_formats

AutoHotkey can access the HTML format of the clipboard, one easy way to do it is using WinClip(). So once you the actual HTML code it is just plain text which you modify like you would any other variable in AutoHotkey (there are more complicated methods as well)

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, jomaweb, Rohwedder and 296 guests