SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Nov 2000
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    checking to see if a URL has right info in it

    Web based
    I have a popuplist which has a list of categories. I use that list to get a count for my variable. I take that variable to go down a list of links that are the same info in the popuplist. But when it starts to go down the list, it wants to capture these three links on the side. Now the way I have to identify these links is by 1)the unique name of the link which could change week to week or 2)by index[#n] which is the way I want but then I end up picking these three links.so what I am doing now is I declare a STRING to capture the URL with GetLocation. Now how do I make my if statement to look at that URL and find out if there is certain text in it. if there is this particular text then click the link else add one to my loop and move on.

    Code:
    [ ] INTEGER i
    [ ] INTEGER iFrysCats
    [ ] iFrysCats = BrowserPage.HtmlPopupList("#1").GetItemCount ()
    [-] for i = 2 to iFrysCats
    [ ] INTEGER iCount = -1
    [ ] STRING sLocation
    [ ] STRING sTest = "deptid"
    [ ] STRING sMyString
    [ ] sMyString = BrowserPage.HtmlLink ("#{i}").GetLocation()
    [-] if sMyString.contains.{sTest}.Exists () //<---Here is the problem I think
    [ ] BrowserPage.HtmlLink ("#{i}").Click ()
    [-] else
    [ ] iFrysCats = iFrysCats + 1
    [ ] ResOpenList ("Locations/Department")
    [ ] Print ("{BrowserPage.HtmlLink ("#{i}").GetLocation()}")
    [ ] Print ("{iCount + i}""{BrowserPage.HtmlLink ("#{i}").GetText ()}")
    [ ] ResCloseList ()
    [ ] Browser.Back.Click()


  2. #2
    Senior Member
    Join Date
    Jun 2000
    Location
    Waltham, MA
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: checking to see if a URL has right info in it

    Well, it looks like it could be a simple syntax problem with your if statement. To check that the sMyString contains a particular text, your if statement should look something like:

    if (StrPos(sTest, sMyString) !=0)

    This line will search sMyString for the sub-string sTest, and returns the position. If the position returned is 0, then the sub-string was not found. So, in the above statement, if the returned position is not 0, then the sTest was found, and would continue to your Click() code.

  3. #3
    Junior Member
    Join Date
    Nov 2000
    Posts
    22
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: checking to see if a URL has right info in it

    Thanks, that was what I needed.

 

 

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 12:42 PM.

Copyright BetaSoft Inc.