Jump to content

Recommended Posts

Posted

I want to copy a text line from a internet page ( i know how to track elements) and show it on a program display

so i dont have to visit the a website every time to check this line or nummers but just to start up a program with ( created with uda formsdesigners) and see/check the nummers.

Posted

A little more information would be helpful...

What website are you getting the information from?

I would probably start by getting the info with InetRead() and then extracting it with a StringRegExp.

Posted

This thread may help. There are some variables that would need to be changed in the code I provided. If you don't understand that, post here again. I or somebody can explain it.

'?do=embed' frameborder='0' data-embedContent>>

Thank you

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



call ("signIn")

Func signIn ()




#include <IE.au3>
$oIE = _IECreate("https://twitter.com/followbacklist3")  ; put the url inside
$sTxt = $oIE.Document.getElementsByclass("js-nav").item(0).innertext
MsgBox(0, "", $sTxt)

EndFunc

i want to get the followers nummer, but i dont know how to get the class,

This is the followers nummer code:

<a class="js-nav" href="/followbacklist3/followers" data-element-term="follower_stats" data-nav="followers">
<strong>830</strong> volgers</a>

how do i get this

Posted

$var = InetRead("https://twitter.com/followbacklist3",1)
$var = BinaryToString($var)

$loc1 = StringInStr($var,'follower_stats" data-nav="followers" data-is-compact="false">      Followers<strong title="')
$len1 = StringLen('follower_stats" data-nav="followers" data-is-compact="false">      Followers<strong title="')
$var = StringTrimLeft($var,$loc1+$len1-1)
$loc1 = StringInStr($var,'"')
$var = StringLeft($var,$loc1-1)

MsgBox(0,"",$var)

This seems to work. Someone the understands Regex better than me could shorten the code.

Posted (edited)

$txt = BinaryToString(InetRead("https://twitter.com/followbacklist3", 1))

$res0 = StringRegExpReplace($txt, '(?s).+data-nav="profile"\D+?(\d*)\D*?(\d+)\s*<.+', "$1$2")
$res1 = StringRegExpReplace($txt, '(?s).+data-nav="following"\D+?(\d*)\D*?(\d+)\s*<.+', "$1$2")
$res2 = StringRegExpReplace($txt, '(?s).+data-nav="followers"\D+?(\d*)\D*?(\d+)\s*<.+', "$1$2")

MsgBox(0,"", "tweets : "&$res0 & @crlf & "following : "&$res1 & @crlf & "followers : "&$res2)

Edit typos

Edited by mikell

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
  • Recently Browsing   0 members

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