Jump to content

Harvest ID'S (Members) from html page


Recommended Posts

Hey guys,

I'm new to autoit, I read like 3 pdfs I can understand the scripts and make something simple only 2 days trying to understand autoit2.

but to create it much more harder. I just need to know how exacly this can be done.

to harvest the ids from this page http://bodyspace.bodybuilding.com/members.php

the usernames you see them as "! ! ! ! aaaa" but when you mouse over there it's like http://bodyspace.bodybuilding.com/aaaa/ <---username

http://bodyspace.bodybuilding.com/abams9/ <---username

I want to be able to harvest all the page and go to next page and to next page.

I think some how to see the page Source of the page and harvest it some how?

Thanks alot!

Edited by voidale
Link to comment
Share on other sites

Hey guys,

I'm new to autoit, I read like 3 pdfs I can understand the scripts and make something simple only 2 days trying to understand autoit2.

but to create it much more harder. I just need to know how exacly this can be done.

to harvest the ids from this page http://bodyspace.bodybuilding.com/members.php

the usernames you see them as "! ! ! ! aaaa" but when you mouse over there it's like http://bodyspace.bodybuilding.com/aaaa/ <---username

http://bodyspace.bodybuilding.com/abams9/ <---username

I want to be able to harvest all the page and go to next page and to next page.

I think some how to see the page Source of the page and harvest it some how?

Thanks alot!

The usernames wouldn't be in email format would they?
Link to comment
Share on other sites

I wish all people here would learn with Welcome to Autoit 1-2-3

Edited just a little...

$Check_String1 = '<a href="http://bodyspace.bodybuilding.com/'
$Check_String2 = '/" class="top_aligned_link">'



; demonstration to find chracters that change between to standard points
; or just find a string
#include <IE.au3>
#include <String.au3>

#Region --- IE-Builder generated code Start ---

$oIE = _IECreate()

;------------- User input --------------
_IENavigate($oIE, "http://bodyspace.bodybuilding.com/members.php") ; web address
$Find = '<a href="http://bodyspace.bodybuilding.com/'  ; my info shows after this line... or just find this line
$Find2 = '/">'  ; my info shows before this line... or set as ""
$Before = '<BR>'
; ------------ End User input -------------

Sleep(1000)
$body = _IEBodyReadHTML($oIE)
$sloc = @TempDir & "\stest.txt" 
FileDelete($sloc)
FileWrite($sloc, $body)
$sfile = FileOpen($sloc, 0)
$num = 0
While 2
    $num = $num + 1
    $sline = FileReadLine($sfile, $num)
    If @error Then
        FileClose($sfile)
        Exit
    EndIf
    If Not StringInStr($sline, "OVERFLOW") then ContinueLoop
    If StringInStr($sline, $Find) Then
        ;MsgBox(64, "Success", "The string " & $Find & " was found    " & @CRLF & " on line # " & $num & @CRLF & $sline, 5)
        If $Before = "" Then ExitLoop
        $Found = _StringBetween($sline, $Find2, $Before)
        If IsArray($Found) Then
        MsgBox(64, "Found", "The string is *" & $Found[0] & "*    ", 5)
        EndIf
    EndIf
WEnd

#EndRegion --- IE-Builder generated code End ---

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I wish all people here would learn with Welcome to Autoit 1-2-3

Edited just a little...

$Check_String1 = '<a href="http://bodyspace.bodybuilding.com/'
$Check_String2 = '/" class="top_aligned_link">'



; demonstration to find chracters that change between to standard points
; or just find a string
#include <IE.au3>
#include <String.au3>

#Region --- IE-Builder generated code Start ---

$oIE = _IECreate()

;------------- User input --------------
_IENavigate($oIE, "http://bodyspace.bodybuilding.com/members.php") ; web address
$Find = '<a href="http://bodyspace.bodybuilding.com/'  ; my info shows after this line... or just find this line
$Find2 = '/">'  ; my info shows before this line... or set as ""
$Before = '<BR>'
; ------------ End User input -------------

Sleep(1000)
$body = _IEBodyReadHTML($oIE)
$sloc = @TempDir & "\stest.txt" 
FileDelete($sloc)
FileWrite($sloc, $body)
$sfile = FileOpen($sloc, 0)
$num = 0
While 2
    $num = $num + 1
    $sline = FileReadLine($sfile, $num)
    If @error Then
        FileClose($sfile)
        Exit
    EndIf
    If Not StringInStr($sline, "OVERFLOW") then ContinueLoop
    If StringInStr($sline, $Find) Then
        ;MsgBox(64, "Success", "The string " & $Find & " was found    " & @CRLF & " on line # " & $num & @CRLF & $sline, 5)
        If $Before = "" Then ExitLoop
        $Found = _StringBetween($sline, $Find2, $Before)
        If IsArray($Found) Then
        MsgBox(64, "Found", "The string is *" & $Found[0] & "*    ", 5)
        EndIf
    EndIf
WEnd

#EndRegion --- IE-Builder generated code End ---

8)

This is really great and working great thanks!

It popup with msg with the id, can it save on txt or something?

and go on to page 2 3 4 5 etc?

Link to comment
Share on other sites

  • Developers

please stop bumping and start putting in some effort yourself.

Come back when you have followed the suggested "Welcome to AutoIt3" training and seriously looked at it yourself.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

Come on no one wanna code it for money?

Which part of my post was unclear to you?

I am closing this and better not start a new topic.

*click*

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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