SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Senior Member
    Join Date
    Mar 2003
    Location
    Portland, OR
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting multiple lines of text from web page?

    All,

    I am trying to get the content of a text file that resides on a web server. The url is as such : http://foo/bar/version.txt. I can navigate to the page fine, but the declaration is a single htmltext object and when I try to read this into a string, I only get the first line of the text. In actuality, the fourth line contains the data that I need but I don't know how to get to it.

    Anyone know how to do this?

    Thanks,

    -John

  2. #2
    Member
    Join Date
    May 2003
    Location
    CA
    Posts
    45
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Use GetMultiText() instead of GetText, if the implementation says it is of type multitext.

    Else use GetContents (LIST OF STRING) and covert the same to STRING format.

  3. #3
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    John,

    I'll frequently copy the contents of the page to the clipboard and then use the clipboard object to find what I want on that page. Would that work for you?

  4. #4
    Senior Member
    Join Date
    Oct 2002
    Location
    Calgary, Alberta, Canada
    Posts
    101
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Originally posted by DJGray:
    John,

    I'll frequently copy the contents of the page to the clipboard and then use the clipboard object to find what I want on that page. Would that work for you?
    <font size="2" face="Verdana, Arial, Helvetica">I do the same thing. It works like a charm.
    Beware of bugs in the above code; I have only proved it correct, not tried it.
    --Donald Knuth

  5. #5
    Senior Member
    Join Date
    Mar 2003
    Location
    Portland, OR
    Posts
    121
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Since it's defined as HmlText and not MultiText, I ended up going with the clipboard method. Works like a charm.

    Thanks all for your replies!

    -John

  6. #6
    Junior Member
    Join Date
    Oct 2002
    Location
    san diego, ca usa
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    I am having a similar problem with objects on the page not getting captured by GetContents. It is giving me the indexes of the objects, but not the captions. It sounds like this approach would work for me as well but...

    how do you copy the contents of the page to the clipboard???

    thanks,

    dave

  7. #7
    Member
    Join Date
    May 2003
    Location
    CA
    Posts
    45
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Hi,

    Place the control on the required object and then TypeKeys (CTRL-A) followed by (CTRL-C) should copy the entire contents of the object.

  8. #8
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    David,

    Exactly what Jillu Bobby said. Then the clipboard is holding a List of String that you can manipulate just like any other list of string.

    e.g.

    Clipboard.lsValues.FindItem("myItem")

  9. #9
    Junior Member
    Join Date
    Oct 2002
    Location
    san diego, ca usa
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Will this work for the contents of the whole page? I have tried:

    Browser.TypeKeys ("&lt;Ctrl-A&gt;")
    Browser.TypeKeys ("&lt;Ctrl-C&gt;")

    and

    PageObject.TypeKeys ("&lt;Ctrl-A&gt;")
    PageObject.TypeKeys ("&lt;Ctrl-C&gt;")

    (where PageObject is the name of the page I want to copy)

    I don't get any errors from these, but I also don't get anything copied to the clipboard. If I do it by hand (no automation), it works as expected. Am I missing something obvious? I need the contents of the whole page.

    thanks,

  10. #10
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting multiple lines of text from web page?

    Start Record/Action from Silk, perform the "by hand" method that works, then see what Silk records. Use that.


    John

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 10:36 AM.

Copyright BetaSoft Inc.