Jump to content

Recommended Posts

Posted

Hello all,

I'm trying to create a webscrape script using AutoIt.  A non-profit I'm involved with is using GroupSpaces.com and there is no notification to the group when someone posts a new topic to the forum.  I'm including IE.au3


#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <String.au3>

; Open Groupspaces.com
Global $oIE = _IECreate ("http://www.groupspaces.com")

_IENavigate($oIE,"http://groupspaces.com/MyCrazyTest/forum/")

;Grab all the links on the Forum page
Global $oLinksCategoryPage = _IELinkGetCollection($oIE)

For $oLink In $oLinksCategoryPage
    Local $oLinkHRef = $oLink.href
    If StringInStr($oLinkHRef,"forum_id") Then
        ;This is a category. Click into it.
        _IENavigate($oIE,$oLinkHRef)
Sleep(3)
        ;Back out to Category List
        _IEAction($oIE,"back")
    EndIf
Next
_IEQuit($oIE)

Posted

Place the links into an Array and then go through them this way for example:

#include <IE.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <String.au3>

; Open Groupspaces.com
Global $oIE = _IECreate ("http://www.groupspaces.com")

_IENavigate($oIE,"http://groupspaces.com/MyCrazyTest/forum/")

;Grab all the links on the Forum page
Global $oLinksCategoryPage = _IELinkGetCollection($oIE)
Global $aLinksCategoryPage[0]
Global $oLinkHRef
For $oLink In $oLinksCategoryPage
    $oLinkHRef = $oLink.href
    If StringInStr($oLinkHRef,"forum_id") Then _ArrayAdd($aLinksCategoryPage, $oLinkHRef)
Next

For $i = 0 To UBound($aLinksCategoryPage) - 1
    _IENavigate($oIE, $aLinksCategoryPage[$i])
Next

 

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
×
×
  • Create New...