Jump to content
Sign in to follow this  
Arclite86

copy and display texst

Recommended Posts

Arclite86

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.

Share this post


Link to post
Share on other sites
dcat127

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.

Share this post


Link to post
Share on other sites
Arclite86

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

Share this post


Link to post
Share on other sites
dcat127

$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.

Share this post


Link to post
Share on other sites
mikell

$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

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.