zreo15 Posted March 13, 2016 Share Posted March 13, 2016 (edited) here is the snippet I found in forums and using $tags = $oIE.document.GetElementsByTagName("div") For $tag In $tags $class_value = $tag.GetAttribute("class") If $class_value = "data" Then $season_no = $tag.innerText ExitLoop EndIf Next to get episode no the problem there is that there are two div tag with same class name and id and the value i want is in second one but the snippet returns only first value so any way to get the second value ? <div class="row"><div class="field">Views: </div> <div class="value">640318</div></div> <div class="row"><div class="field">Episodes: </div> <div class="value">11</div></div> here is the page url http://o2tvseries.com/Agents-of-SHIELD/Season-03/index.html EDIT1:Error resolved EDIT2:Space problem resolved ( there was a single space there added but the console log showed a big one so i panicked ) Edited March 13, 2016 by zreo15 i reosolved the error but the unexpected space still remains Link to comment Share on other sites More sharing options...
tarretarretarre Posted March 13, 2016 Share Posted March 13, 2016 Your script have an "Exitloop" which means it should stop after the first match, Use this instead: #include <IE.au3> #include <MsgBoxConstants.au3> #include <Array.au3> Local $oIE = _IECreate("http://o2tvseries.com/Agents-of-SHIELD/Season-03/index.html") Local $oTags = _IETagNameGetCollection($oIE, "div") Local $aResults[1] For $oTag In $oTags if $oTag.GetAttribute("class") == "data" Then _ArrayAdd($aResults, $oTag.innerTEXT) EndIf Next $aResults[0] = UBound($aResults) - 1 _ArrayDisplay($aResults, "Episodelist") _IEQuit($oIE) Socket-IO - An event-driven TCP UDF (Realtime chat example) AutoIt-API-WS - An expressive HTTP server you can use to build your own API with (Screenshots) Link to comment Share on other sites More sharing options...
zreo15 Posted March 13, 2016 Author Share Posted March 13, 2016 oh okay got it thanks for help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now