Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 18:16

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[AutoIT] get information by ie.au3

Discussion on [AutoIT] get information by ie.au3 within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1


 
elite*gold: 122
Join Date: May 2014
Posts: 2,721
Received Thanks: 531
[AutoIT] get information by ie.au3

I have this line

<div class="onlysample">lol</div>

How I can read out this "lol" and do it in a listbox from the ie.au3.

Notice: Next time the "lol" is different, it's for example "lol2" or "lol59095"
Melli- is offline  
Old 05/19/2017, 21:41   #2


 
Moneypulation's Avatar
 
elite*gold: 138
Join Date: Apr 2012
Posts: 3,495
Received Thanks: 1,769
You can use _StringBetween to find the value inside the div container, but what do you mean with "do it in a listbox from the ie.au3"? is there a listbox on the webpage and you want to add this as an item or do you want to do that in your AutoIt Form?
Moneypulation is offline  
Old 05/20/2017, 11:06   #3


 
elite*gold: 122
Join Date: May 2014
Posts: 2,721
Received Thanks: 531
Quote:
Originally Posted by Moneypulation View Post
You can use _StringBetween to find the value inside the div container, but what do you mean with "do it in a listbox from the ie.au3"? is there a listbox on the webpage and you want to add this as an item or do you want to do that in your AutoIt Form?
There are div's and I want to add for one div string a new list item.
Melli- is offline  
Old 05/20/2017, 22:52   #4



 
xShizoidx's Avatar
 
elite*gold: 0
The Black Market: 279/0/0
Join Date: Feb 2011
Posts: 1,342
Received Thanks: 410
Habe hierfür mal kurz eine Funktion erstellt :

Code:
#include <IE.au3>
#include <Array.au3>

$IE = _IECreate("http://getbootstrap.com/components/#alerts")

$htmlTags = _IETagNameAllGetCollection($IE):

$result = getTextContentByClassName("alert alert-success")
_ArrayDisplay($result)

Func getTextContentByClassName($className)
   Local $textContents = []
   For $tag in $htmlTags
	   $classValue = $tag.GetAttribute("class")
		 If StringInStr($classValue,$className) > 0 Then
			_ArrayAdd($textContents,$tag.innerText)
		 EndIf
	  Next
   $textContents[0] = UBound($textContents)-1
   return $textContents
EndFunc
xShizoidx is offline  
Thanks
1 User
Old 05/24/2017, 03:51   #5
 
elite*gold: 0
Join Date: May 2017
Posts: 3
Received Thanks: 0
Code:
Local $sSourceHTML ; your source by InetGet or other
Local $aArray = StringRegExp($sSourceHTML, '<div class="onlysample">(lol\d*)</div>', 1) ; simples quotes because they are doubles quotes in pattern
Local $sLolOut = $aArray[0] ; done
symphonick is offline  
Reply




All times are GMT +2. The time now is 18:16.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.