Jump to content

Taking Information From Website?


Recommended Posts

Hello Autoit Community!

After much testing and research, I am at a dead end.  I am looking to do the following:

  • Take specific information from a website
  • Use that specific information in an Autoit program

 

Seems like a simple task, but I am having trouble searching through source for specific information and then using it to show in a GUI.  I know how to get the source, save it (if needed), but for some reason, I have problems searching for specific information within the source for later use.

Any help on what to look for?

 

Thanks for all of the help!

Link to comment
Share on other sites

look at _IE_introduction

.

; *******************************************************
; Example 1 - Open a browser with the basic IE.au3 introductory text displayed
; *******************************************************

#include <IE.au3>

Local $oIE = _IE_Introduction("basic")

.

and

.

; *******************************************************
; Example 1 - Create browser windows with each of the example pages displayed.
;               The object variable returned can be used just as the object
;               variables returned by _IECreate or _IEAttach
; *******************************************************

#include <IE.au3>

Local $oIE_basic = _IE_Example("basic")
Local $oIE_form = _IE_Example("form")
Local $oIE_table = _IE_Example("table")
Local $oIE_frameset = _IE_Example("frameset")
Local $oIE_iframe = _IE_Example("iframe")

.

E.

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

look at _IE_introduction

.

; *******************************************************
; Example 1 - Open a browser with the basic IE.au3 introductory text displayed
; *******************************************************

#include <IE.au3>

Local $oIE = _IE_Introduction("basic")

.

and

.

; *******************************************************
; Example 1 - Create browser windows with each of the example pages displayed.
;               The object variable returned can be used just as the object
;               variables returned by _IECreate or _IEAttach
; *******************************************************

#include <IE.au3>

Local $oIE_basic = _IE_Example("basic")
Local $oIE_form = _IE_Example("form")
Local $oIE_table = _IE_Example("table")
Local $oIE_frameset = _IE_Example("frameset")
Local $oIE_iframe = _IE_Example("iframe")

.

E.

So I was actually looking at this a bit (not introduction though) and it seems like example actually opens an IE window, that's why I preferred the Inetgetsource over that, but I will look into IEIntroduction

Link to comment
Share on other sites

look at all the _IE_ functions. there are plenties

 

your request is not very specific. try to explain better what you want to achieve and the code that you already used.

Edited by Edano

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

look at all the _IE_ functions. there are plenties

 

your request is not very specific. try to explain better what you want to achieve and the code that you already used.

I deleted a lot of the code because I thought I found a better way to do it, but I have not.  I will update this thread with the code when I have it finished.

 

To give an example:

I want this script to go to "www.google.com", locate the text that says "with animated pics and more" (it's at the bottom of the page) and display that in the GUI.

Link to comment
Share on other sites

well if you are familiar with stringsplit and other string function, than you can cut it out of the scource code from inetget().

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Alright, so I have a bit set up, here is my next roadblock:

 

Let's say I have a String, "Hi everyone, my name is Amathian!"

I want to save, "my name is" to a different variable (basically taking it out of the string as a whole), how would I do this?

 

To give more detail:

I am trying to take information from source code, so lets say I have strings:

 

"Hi, my name is Amathian"

"Hi my eman is amathian"

"Hi my nmea is Amathian"

I am looking to take out the middle 3 words and save them to different variables.

Edited by Amathian
Link to comment
Share on other sites

$r_sumname = iniread ("settings.ini", "Settings", "Summoner Name", "")
$r_serv = iniread ("settings.ini", "Settings", "Server", "")
$url= "http://blah.com/NA/search?name=blah&server=NA" 
$source = _INetGetSource ($url)
  
   
   I mean, pasting code isn't going to really help, as there is a lot to it, but there, the next step for me is to find specific items within $source so I can save it a variable, and use it later in the GUI.
Edited by Amathian
Link to comment
Share on other sites

the problem is, nobody understands what you want. you have to be specific and exact. you cannot say "blah" and expect a code in return

[color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font]

Link to comment
Share on other sites

Hi, Edano, with the help you gave me I was able to figure out what I needed to do:

 

I basically found the line the code was on, and trimmed around it so the information I want is extracted.  It is a bit sketchy, but it works!

local $tr, $sr, $c = 0, $sch
   $tr = StringTrimRight ($source_a[326], 4)
   $sr = StringRight ($tr, 30)
   While $c <> 50
      $sr = StringTrimLeft ($sr, 1)
      $c = $c + 1
      $sch = Stringinstr ($sr, ">")
      if $sch = 0 Then
         ExitLoop
      EndIf
   WEnd
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...