It is possible to copy text from some websites and paste it in notepad? Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 10:14

I want copy some specific text from 3-4 websites, the problem is the text always changes, but it always has the same word on each line so that could be used as a guide or something?
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 10:47

it is but without more info I cant really help any further look into comobj
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 12:23

donovv wrote:it is but without more info I cant really help any further look into comobj
I'm sorry if I didn't explain it very well, could you tell me what info do you need?
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 12:30

ill see if i can make an example script to show you but without seeing the webpage source i couldn't ensure it will work in the same way
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 12:54

donovv wrote:ill see if i can make an example script to show you but without seeing the webpage source i couldn't ensure it will work in the same way
https://pastebin.com/archive

That's the website, I want to check every hour if one of the texts there ends with the word "WTP" and if it does just copy the name of the file and the link. I don't know if this is too hard to do, but if you don't have the time to make an example just tell me what I should learn to do this.
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 15:51

im working on something for you right now give me a few hours i'm working on it during my free time at work
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 16:12

Yolomangolo wrote:Could you explain me how?
where would the WTP be? is it under the syntax line?
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 16:33

donovv wrote:Where would the WTP be? is it under the syntax line?
WTP is always going to be in the title along with some numbers. An example would be something like 850430WTP. Since the numbers always change WTP would be only way to 'find' the file (I think?).
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?  Topic is solved

04 Apr 2018, 17:14

Code: Select all

#persistent
#singleinstance force
settimer,sub1,3600000

sub1:
	urldownloadtofile,https://pastebin.com/archive,downl.txt
	loop, read, downl.txt
	{
		regexmatch(a_loopreadline,"<td>.+<\/td>",z)
		if z != 
			{
				regexmatch(z,"i).*wtp.*",x)
					if x != 
						fileappend,%x%`n,test.txt
			}
	}
filedelete, downl.txt
return
return
semi tested
also i got kinda lazy so thats just gonna give you
<td><img src="/i/t.gif" class="i_p0" alt="" /><a href="/sPycERgn">Untitled</a></td>

the title will be where the untitled is the link is going to be pastebin.com/sPycERgn changed the colored part to what it is for your links ill work on it more when i get home from work
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 18:57

donovv wrote:

Code: Select all

#persistent
#singleinstance force
settimer,sub1,3600000

sub1:
	urldownloadtofile,https://pastebin.com/archive,downl.txt
	loop, read, downl.txt
	{
		regexmatch(a_loopreadline,"<td>.+<\/td>",z)
		if z != 
			{
				regexmatch(z,"i).*wtp.*",x)
					if x != 
						fileappend,%x%`n,test.txt
			}
	}
filedelete, downl.txt
return
return
semi tested
also i got kinda lazy so thats just gonna give you
<td><img src="/i/t.gif" class="i_p0" alt="" /><a href="/sPycERgn">Untitled</a></td>

the title will be where the untitled is the link is going to be pastebin.com/sPycERgn changed the colored part to what it is for your links ill work on it more when i get home from work
It worked but I changed the milliseconds from 3600000 to 1 for testing and got banned for a few hours for suspicious activity, lol. While the temporary ban gets removed I was trying to test this script on other websites changing some things like WTP and the link, but it doesn't work. A random page for this example would be https://www.reddit.com/r/EggLeague/ this is the code I used, but i's not working. I am trying to do the same thing with WTP but in this case it's with the first post.

Code: Select all

#persistent
#singleinstance force
settimer,sub1,10000

sub1:
	urldownloadtofile,https://www.reddit.com/r/EggLeague/
	loop, read, downl.txt
	{
		regexmatch(a_loopreadline,"<td>.+<\/td>",z)
		if z != 
			{
				regexmatch(z,"i).*34563463.*",x)
					if x != 
						fileappend,%x%`n,test.txt
			}
	}
filedelete, downl.txt
return
return
I know I have to change something else but I don't what.
Dono

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 19:02

Reddit uses a different type of layout I’ll have to look when I get home but it won’t be for a few hours
Yolomangolo
Posts: 7
Joined: 04 Apr 2018, 10:04

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 21:06

Dono wrote:Reddit uses a different type of layout I’ll have to look when I get home but it won’t be for a few hours
Yeah sure, no problem. It's not necessary, I don't really need it for reddit, I just want to understand how it works.
donovv
Posts: 108
Joined: 15 Apr 2017, 21:06

Re: It is possible to copy text from some websites and paste it in notepad?

04 Apr 2018, 22:02

so ya im home now took a look at reddits source and im not really ready for that challenge right now xD feel free to pm me if you have any questions though

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 272 guests