Jump to content

Recommended Posts

Posted

hi all

im using inetread but it is getting me the source of the page , is their is a way to only get the text that a normal user see when he visit the site? i dont want the source code

Posted
JLogan3o13

 

it seems that _IEBodyReadText is only for getting text from already opened ie 

i want to get text from a site for example "facebook.com"

 

 when i use inetread("facebook.com") i get the source code of the page.

i want to get the text in that webpage 

"Connect with friends and thFind more of what you're looking for with Graph Search"

Posted (edited)

InetRead returns the source of the page if its directed to it, the source after all is a file. unless you meant something else.

 

EDIT: here you go

#include <IE.au3>

$oIE = _IECreate("facebook.com")
$oText = _IEGetObjById($oIE, "pagelet_bluebar")
ConsoleWrite($oText.innertext & @CR)
Edited by Palestinian
  • Moderators
Posted (edited)

I personally only use it for reading files, have never simply pointed it at the URL to get source (silly me I use _INetGetSource for that). I would think the easiest way is with _IEBodyReadText, and make the window invisible if you want:

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

Local $oIE = _IECreate("www.autoitscript.com", 0, 0)
Local $sText = _IEBodyReadText($oIE)
MsgBox($MB_SYSTEMMODAL, "Body Text", $sText)

_IEQuit($oIE)

I am sure someone much smarter than I will wander along, and may have another way of doing it.

 

Edit: Or if the window is already open:

#include <IE.au3>
#include <MsgBoxConstants.au3>
 
Local $oIE = _IEAttach("http://stevedonovan.github.io/winapi/api.html", "url", 1)
Local $sText = _IEBodyReadText($oIE)
MsgBox($MB_SYSTEMMODAL, "Body Text", $sText)
 
_IEQuit($oIE)
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
×
×
  • Create New...