gui529 Posted May 2, 2009 Posted May 2, 2009 Goal: I want get a text from a website and save it. I know how save stuff in autoit, I just dont know how to get a specific text from a website by viewing source.The website is http://www.archlordgame.com/freetoplay.php and i need bot to get the line and extract the key which is AT13A-XX-XXXX .... etc. *The key will change everytime you refresh.<div id="key_box"><span id="copytext">AT13A-WEJXV-PHQ7X-0VNLF-GBBW9</span></div>I looked into the HELPFILE and The closest thing I got was getting the source. But I couldnt find what to do next.#include <INet.au3> ConsoleWrite(_INetGetSource('http://www.archlordgame.com/freetoplay.php'))
blakel Posted May 2, 2009 Posted May 2, 2009 use StringRegExp The pattern would be ">[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}<" assuming I got the regex correct
Quual Posted May 2, 2009 Posted May 2, 2009 #include <INet.au3> $source = ConsoleWrite(_INetGetSource('http://www.archlordgame.com/freetoplay.php') $key = StringRegExp($source, '(\w{5}-\w{5}-\w{5}-\w{5}-\w{5})', 1) ConsoleWrite( $key[0] & @CRLF) This regexp works fine, but it looked like you have to manually enter a anti-bot code in order to get to that page <img src="images/freetoplay/EnglishUSA/step1.jpg" alt="Claim your key" /><br /> <form name="keyentry" action="/freetoplay.php" method="POST"> So unless you know a way around that ^ its not going to work It worked fine when I copied / pasted the source page to a temp file and ran the regex on it
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now