Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [VB6] Grabbing Neopet Shop Item obj_id Value

  1. #1
    Vinko's Avatar
    Joined
    Mar 2012
    Posts
    204
    Userbars
    2
    Thanks
    52
    Thanked
    85/40
    DL/UL
    32/3
    Mentioned
    32 times
    Time Online
    1d 24m
    Avg. Time Online
    N/A

    [VB6] Grabbing Neopet Shop Item obj_id Value

    Can someone please point out the mistake i am making,
    I am trying to make strVal = 7465
    i have worked on it different ways for like the past 2 hrs and can't figure it out.
    Please someone make me feel dumb and show me thhe error of my ways.



    Dim strHTML as String, strVal as String


    strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your")
    strVal= GetStringBetween(strHTML, "<b>Special</b>", "<input type")
    strVal= GetStringBetween(strVal, "value='", "'><input type"


    Spoiler taken straight from the source code of the page, when i view it in firefox.




    "I prefer the term nooblet (:" - Sherri

  2. #2

    Joined
    Feb 2012
    Posts
    223
    Userbars
    4
    Thanks
    72
    Thanked
    44/13
    DL/UL
    60/2
    Mentioned
    29 times
    Time Online
    1d 21h 39m
    Avg. Time Online
    N/A
    This would just be my guess, but possibly make another variable for StrVal
    I.E.
    Dim StrVal1 as String
    strVal= GetStringBetween(strVal1, "value='", "'><input type"
    Also maybe you need a referral in strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your" ?

    That's just my guess though

  3. #3
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,906
    Thanked
    33,077/6,608
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 25m
    Avg. Time Online
    3h 13m
    ^More efficient to just store in strVal first then grab from strVal again and assign final value.
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  4. #4
    Vinko's Avatar
    Joined
    Mar 2012
    Posts
    204
    Userbars
    2
    Thanks
    52
    Thanked
    85/40
    DL/UL
    32/3
    Mentioned
    32 times
    Time Online
    1d 24m
    Avg. Time Online
    N/A
    Quote Originally Posted by jojo View Post
    This would just be my guess, but possibly make another variable for StrVal
    I.E.
    Dim StrVal1 as String
    strVal= GetStringBetween(strVal1, "value='", "'><input type"
    Also maybe you need a referral in strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your" ?

    That's just my guess though
    I was thinking the same thing but even when i took the last step out strVal returned nothing

    both label1 and list1 come back with nothing.

    then when i did

    it tells me no everytime.


    its like strHTML is not grabbing the full source code.

    @(you need an account to see links)
    Last edited by Vinko; 04-25-2012 at 11:23 PM.




    "I prefer the term nooblet (:" - Sherri

  5. #5

    Joined
    Dec 2011
    Posts
    262
    Thanks
    22
    Thanked
    106/68
    DL/UL
    22/0
    Mentioned
    74 times
    Time Online
    N/A
    Avg. Time Online
    N/A
    Does the wrapper use "" or '' for its HTML? I'd try debug every step to see where it is going wrong to start with.

  6. #6
    Vinko's Avatar
    Joined
    Mar 2012
    Posts
    204
    Userbars
    2
    Thanks
    52
    Thanked
    85/40
    DL/UL
    32/3
    Mentioned
    32 times
    Time Online
    1d 24m
    Avg. Time Online
    N/A
    Quote Originally Posted by Josh View Post
    Does the wrapper use "" or '' for its HTML? I'd try debug every step to see where it is going wrong to start with.
    not sure josh, it is the ripperwrapper that i got off this site.

    EDIT: Oh josh it uses " around the http and anytime there is one in the strand i have to put another one.

    really new to all this, basically i want it to price thee items in my shop

    using the value in my text box..

    it works using this




    but that is because in the coding i have the value actually typed in, it is for one of the codestones.
    not everytime will the item be this codestone so i am trying to grab the value so i can make it a variable.
    Last edited by Vinko; 04-25-2012 at 11:30 PM.




    "I prefer the term nooblet (:" - Sherri

  7. #7

    Joined
    Dec 2011
    Posts
    262
    Thanks
    22
    Thanked
    106/68
    DL/UL
    22/0
    Mentioned
    74 times
    Time Online
    N/A
    Avg. Time Online
    N/A
    Code:
    Dim strHTML as String, strVal as String
    
    strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your")
    strVal= GetStringBetween(strHTML, "<b>Special</b>", "<input type")
    msgbox strVal
    strVal= GetStringBetween(strVal, "value='", "'><input type")
    See if the msgbox fills with what is meant to be grabbed.

  8. #8
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Quote Originally Posted by Vinko View Post
    Can someone please point out the mistake i am making,
    I am trying to make strVal = 7465
    i have worked on it different ways for like the past 2 hrs and can't figure it out.
    Please someone make me feel dumb and show me thhe error of my ways.



    Dim strHTML as String, strVal as String


    strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your")
    strVal= GetStringBetween(strHTML, "<b>Special</b>", "<input type")
    strVal= GetStringBetween(strVal, "value='", "'><input type"


    Spoiler taken straight from the source code of the page, when i view it in firefox.
    I'm disappointed with the responses thus far. Do you guys even put thought into these responses?

    Code:
    strVal = GetStringBetween(strHTML, "<b>Special</b>", "<input type")
    is the problematic line.

    Look at the HTML you posted:
    Code:
    <b>Special</b></td><input type='hidden' name='obj_id_1' value='7465'>
    that getbetween returns "</td>"

    Try this:
    Code:
    strHTML = w.Request("GET", "http://www.neopets.com/market.phtml?type=your")
    strVal = GetStringBetween(strHTML, "<b>Special</b>", "<td")
    strVal = GetStringBetween(strVal, "value='", "'")
    This is a perfect time to use Regex

  9. #9
    Vinko's Avatar
    Joined
    Mar 2012
    Posts
    204
    Userbars
    2
    Thanks
    52
    Thanked
    85/40
    DL/UL
    32/3
    Mentioned
    32 times
    Time Online
    1d 24m
    Avg. Time Online
    N/A
    @zach

    I tried the above method and it didn't work
    so I used the feature you showed me with Ctrl+G
    and made it to where strHTML showed in that,
    it doesn't appear to be all the source code from the page.




    "I prefer the term nooblet (:" - Sherri

  10. #10
    Zachafer's Avatar
    Joined
    Dec 2011
    Posts
    1,235
    Userbars
    11
    Thanks
    769
    Thanked
    1,466/678
    DL/UL
    98/0
    Mentioned
    512 times
    Time Online
    24d 13h 9m
    Avg. Time Online
    8m
    Quote Originally Posted by Vinko View Post
    @zach

    I tried the above method and it didn't work
    so I used the feature you showed me with Ctrl+G
    and made it to where strHTML showed in that,
    it doesn't appear to be all the source code from the page.
    Probably one of two things:
    - Immediate Window / CTRL+G (Debug.print) only displays so many characters
    - Wrapper doesn't like running in IDE mode

    Try:
    - Turning off GZIP in the Wrapper (should be a boolean Property in the Properties Window)
    - Compiling your program to a .exe and then writing the HTML contents to a file (Open , Input , Close)

Posting Permissions

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