Jump to content
Sign in to follow this  
Killer_Hammster

Reading a specific line from a webpage

Recommended Posts

Killer_Hammster

Hello, its me again, I was woundering if there is anyway to read a specific line of text from a webpage or a select few lines then return them? I have tryed lots of differnt things but sofar I can only return the whole page, and I only need 1 or 2 lines, anyone know how?

Share this post


Link to post
Share on other sites
big_daddy

Can you provide a link to the webpage or at least a section of the source that includes the text you are wanting.

Share this post


Link to post
Share on other sites
Killer_Hammster

This part I need the program to look at looks like this

<div class="fw-text"> <!-- ParagraphBodyStart --><P>Block 1</P>

<P>## . ## . ## . ##</P>

<P>## . ## . ## . ##</P>

<P>## . ## . ## . ##</P>

<P>&nbsp;</P>

<P>Block 2</P>

<P>## . ## . ## . ##</P>

<P>## . ## . ## . ##</P>

<P>## . ## . ## . ##</P><!-- ParagraphBodyEnd --> </div>

If you really need the website I can post that if you would like

Share this post


Link to post
Share on other sites
big_daddy

Assuming this webpage does not contain frames this should work.

#include <IE.au3>

$sText = ""
$sURL = "www.YourWebpage.com"
$oIE = _IECreate($sURL)
$oDivs = _IETagNameGetCollection($oIE, "DIV")
For $oDiv In $oDivs
    If $oDiv.className = "fw-text" Then
        $sText = $oDiv.innerText
        ExitLoop
    EndIf
Next
ConsoleWrite($sText & @CR)

Share this post


Link to post
Share on other sites
macdad

this is really close to what im looking for but i want to make it do one of 2 mouse clicks 1 if it matches and the other if it doesnt and also is there any way to make it look for the first one on the page since there is multiple lists of them for example if u play games on fb your gift page im wanting it to look at the first gift and if it mates then to do mouse click here and there both what im wanting to use this for and facebook gift page is written with <div> so there is multiple. maybe if it looks in a specific area of the page if thats possable. i will be watching this thread for a reply

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×