PDA

View Full Version : interact with web page



thmh
07-01-2011, 11:41 AM
hy
have sheet with list of football matches and bets ,
need macro to:

1. open ie , - done
2. navigate to selection page, - done
3. select bet on web , - here is problem when macro opens page i don't now how to select bet

example:

sheet with bets

http://www.easilysharing.com/images/59881472362287448688.jpg

web page

http://www.easilysharing.com/images/33725949308527919220.jpg

web source




<h2>1x2</h2>
<div id="odds_list">
<div class="odds_header">
<span>Sat 11-08-06</span>
</div>
<div class="odds_body">
<table>
<tr>
<td colspan="6"><span class="odds_row_header">Fra. Ligue 1</span></td>
</tr>
<tr class="odds_row ">
<td class="odds_row_time">
<span class="time">
19:00</span>
</td>
<td class="textleft">
<span>
<a href="/sports/event/fra-ligue-1/montpellier---auxerre/6833450">Montpellier - Auxerre</a>
</span>
</td>
<td class="m1X2">
<table>
<tr>
<td>
<a href="" id="ab_45108775" class="ob tb" onclick="return bs.ta(event,45108775,6833450);">
<span class="left">1</span>
<span class="right">2.15</span>
</a>
</td>
<td>
<a href="" id="ab_45108776" class="ob tb" onclick="return bs.ta(event,45108776,6833450);">
<span class="left">X</span>
<span class="right">3.05</span>
</a>
</td>
<td>
<a href="" id="ab_45108777" class="ob tb" onclick="return bs.ta(event,45108777,6833450);">
<span class="left">2</span>
<span class="right">3.60</span>
</a>
</td>
</tr>
</table>
</td><td class="odds_more" style="text-align: center;">
<a href="javascript:cteams(397,386,'SOCMENEURFRAFST');">
<img src="/images/sports/stats.png"/>
</a>
</td>
</tr>
<tr class="odds_row bg-vvvlightgrey">
<td class="odds_row_time">
<span class="time">
19:00</span>
</td>
<td class="textleft">
<span>
<a href="/sports/event/fra-ligue-1/marseille---sochaux/6833449">Marseille - Sochaux</a>
</span>
</td>
<td class="m1X2">
<table>
<tr>
<td>
<a href="" id="ab_45108772" class="ob tb" onclick="return bs.ta(event,45108772,6833449);">
<span class="left">1</span>
<span class="right">1.50</span>
</a>
</td>
<td>
<a href="" id="ab_45108773" class="ob tb" onclick="return bs.ta(event,45108773,6833449);">
<span class="left">X</span>
<span class="right">3.95</span>
</a>
</td>
<td>
<a href="" id="ab_45108774" class="ob tb" onclick="return bs.ta(event,45108774,6833449);">
<span class="left">2</span>
<span class="right">6.75</span>
</a>
</td>
</tr>
</table>
</td><td class="odds_more" style="text-align: center;">
<a href="javascript:cteams(392,18531,'SOCMENEURFRAFST');">
<img src="/images/sports/stats.png"/>
</a>
</td>
</tr>
<tr class="odds_row ">
<td class="odds_row_time">
<span class="time">
19:00</span>
</td>
<td class="textleft">
<span>
<a href="/sports/event/fra-ligue-1/nancy---lille/6833452">Nancy - Lille</a>
</span>
</td>
<td class="m1X2">
<table>
<tr>
<td>
<a href="" id="ab_45108929" class="ob tb" onclick="return bs.ta(event,45108929,6833452);">
<span class="left">1</span>
<span class="right">3.45</span>
</a>
</td>
<td>
<a href="" id="ab_45108930" class="ob tb" onclick="return bs.ta(event,45108930,6833452);">
<span class="left">X</span>
<span class="right">3.00</span>
</a>
</td>
<td>
<a href="" id="ab_45108931" class="ob tb" onclick="return bs.ta(event,45108931,6833452);">
<span class="left">2</span>
<span class="right">2.25</span>
</a>
</td>
</tr>
</table>
</td><td class="odds_more" style="text-align: center;">
<a href="javascript:cteams(396,1193,'SOCMENEURFRAFST');">
<img src="/images/sports/stats.png"/>
</a>
</td>
</tr>
<tr class="odds_row bg-vvvlightgrey">
<td class="odds_row_time">
<span class="time">
19:00</span>
</td>
<td class="textleft">
<span>
<a href="/sports/event/fra-ligue-1/nice---lyon/6833451">Nice - Lyon</a>
</span>
</td>
<td class="m1X2">
<table>
<tr>
<td>
<a href="" id="ab_45108838" class="ob tb" onclick="return bs.ta(event,45108838,6833451);">
<span class="left">1</span>
<span class="right">3.95</span>
</a>
</td>
<td>
<a href="" id="ab_45108839" class="ob tb" onclick="return bs.ta(event,45108839,6833451);">
<span class="left">X</span>
<span class="right">3.05</span>
</a>
</td>
<td>
<a href="" id="ab_45108840" class="ob tb" onclick="return bs.ta(event,45108840,6833451);">
<span class="left">2</span>
<span class="right">2.05</span>
</a>
</td>
</tr>
</table>
</td><td class="odds_more" style="text-align: center;">
<a href="javascript:cteams(30001,389,'SOCMENEURFRAFST');">
<img src="/images/sports/stats.png"/>
</a>
</td>
</tr>



my macro so far



Sub login_bookie()

Dim ie As Object
Dim dtNow As Date
Set ie = CreateObject("InternetExplorer.Application")

' With ie

ie.Navigate "https://www.expekt.com/login/loginIFrame.do?bgColor=BFBDBD&redirectLogin=home.do&skipParams=true" 'load web page google.com
' Do While .Busy: DoEvents: Loop
' Do While .readystate <> 4: DoEvents: Loop
'.Visible = True
While ie.Busy
DoEvents 'wait until IE is done loading page.
Wend
ie.Visible = True

dtNow = Now
Do
DoEvents
Loop While Now < DateAdd("s", 4, dtNow)

'With ie
ie.document.All.Item("userNameInput").Value = "" '.Item
ie.document.All.Item("passInput").Value = ""
ie.document.All("login").Click '.Value = ""

dtNow = Now
Do
DoEvents
Loop While Now < DateAdd("s", 4, dtNow)

ie.document.All("sport").Click

dtNow = Now
Do
DoEvents
Loop While Now < DateAdd("s", 4, dtNow)

'ie.Document.All.innerText("15 leagues").Click
ie.Navigate "https://www.expekt.com/sports/odds.do?categoryCode=266056&datePeriod=1000000" '

'End With

End Sub

stanleydgrom
07-02-2011, 04:31 AM
thmh,

Try:

Automation of an system issue.
check out autoit
http://autoitscript.com/autoit3

it's a free, high level basic based programming language that makes working with all areas of the windows API pretty simple. including sending directly to any standard control. there's a great support forum over there also and feel free to pm me here or there (Cameronsdad is my name over there) if you go that route and have any questions Easy to learn BASIC-like syntax Simulate keystrokes and mouse movements Manipulate windows and processes Interact with all standard windows controls Scripts can be compiled into standalone executables Create Graphical User Interfaces (GUIs) COM support Regular expressions Directly call external DLL and Windows API functions Scriptable RunAs functions Detailed helpfile and large community-based support forums Compatible with Windows 2000 / XP / 2003 / Vista / 2008 / Windows 7 / 2008 R2 Unicode and x64 support Digitally signed for peace of mind Works with Windows Vista's User Account Control (UAC)


Have a great day,
Stan