Jump to content
Sign in to follow this  
gui529

Text from a Website Source

Recommended Posts

gui529

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'))

Share this post


Link to post
Share on other sites
blakel

use StringRegExp

The pattern would be

">[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}-[:alnum:]{5}<"

assuming I got the regex correct

Share this post


Link to post
Share on other sites
Quual

#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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.