How to use IEGetAllText or It not working

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
nodochau
Pro Scripter
Posts: 131
Joined: Wed Jan 16, 2019 12:59 pm

How to use IEGetAllText or It not working

Post by nodochau » Thu Apr 02, 2020 6:06 pm

Hello All,
I am trying to get all the text (html) in the web page but I get no luck.. Any ideas.
Here is my code:

Code: Select all

XLOpen>C:\Users\1\Desktop\Jane2.xlsx,0,xlBook
let>empty_cell=
WaitWindowOpen>Excel*
let>m=1
XLGetCell>xlBook,Sheet2,%m%,1,competitor
While>competitor<>empty_cell
  Add>m,1
  XLGetCell>xlBook,Sheet2,%m%,1,competitor
  let>competitor%m%=competitor
EndWhile
  XLQuit>xlBook
  IECreate>IE[0]
  IENavigate>IE[0], http://www.amazon.com,ie_res
  IEWait>amzon.com
  Let>tmp1=Amazon.com*
  WindowAction>1,tmp1
  Wait>.5
let>mm=2
Repeat>mm
  let>ASIN_num=competitor%mm%
  IEGetTags>amazon.com,INPUT,O,tags
  //find the search box (name=field-keywords)
  Let>p=0
  Let>k=0
  While>p=0
    Let>k=k+1
    let>my_tag=tags_%k%
    //mdl>my_tag
    Pos>name="field-keywords",my_tag,1,p
  EndWhile
  Wait>.5
  //Enter a search term in it ...
  IETagEvent>amazon.com,INPUT,k,,%ASIN_num%
  //Find the Go button
  Let>p=0
  Let>k=0
  While>p=0
    Let>k=k+1
    Let>go_tag=tags_%k%
    Pos>class="nav-input",go_tag,1,p
  EndWhile
  Wait>.5
  //click it ...
  IETagEvent>amazon.com,INPUT,k,Click,
  IEWait>amzon.com
  Wait>3

//**BREAKPOINT**
  IEGetURL>IE[0],competitor_url
    **BREAKPOINT**
  IEGetAllText>competitor_url,2,res
Until>mm=2

User avatar
Marcus Tettmar
Site Admin
Posts: 7378
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Re: How to use IEGetAllText or It not working

Post by Marcus Tettmar » Fri Apr 03, 2020 9:47 am

IEGetAllText requires an IE reference, so you need:

Code: Select all

IEGetAllText>IE[0],2,res
You don't need the preceding IEGetURL.

See:
https://www.mjtnet.com/manuals/v15/HTML ... ltext.html
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts