Results 1 to 6 of 6

Thread: How do i get this info???

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    17

    How do i get this info???

    this is the source of a web page:

    href="http://www.darkthrone.com/members.dt?session=5b87817b6aa7c090452aed479831a41f">Need
    more citizens? You can gain an additional 25 citizens per day
    by recruiting friends and family, using your recruit link
    outside of the official recruiter.</A><BR><BR><A
    href="http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&amp;alliance=-1&amp;ticket=147630"><IMG
    alt="Start Recruiting"
    src="Dark Throne (beta)_files/startrecruiting.gif"></A><BR><BR>
    <DIV class=box_border style="WIDTH: 550px">
    <TABLE cellSpacing=2 cellPadding=1 width="100%">

    And i want to extract :

    href="http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&amp;alliance=-1&amp;ticket=147630"

    and then put in this code:
    wb1.navigate "http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&alliance=-1&ticket=147630"

    Pls help me!!!

  2. #2
    Fanatic Member ALL's Avatar
    Join Date
    Jul 2004
    Location
    192.168.1.1
    Posts
    711
    use the Mid statment and the InStr Statment

    Example:
    VB Code:
    1. Dim strHTMLcode as String, temp
    2. temp = InStr(1, strHTMLcode, "href=" & Chr(34) & "http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&alliance=-1&ticket=147630")
    3. Mid strHTML, temp, Len("href=http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&alliance=-1&ticket=147630") + 1  = "wb1.navigate " & Chr(34) & "http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&alliance=-1&ticket=147630"
    4. 'ADD 1 because of the " that is gone
    Last edited by ALL; Sep 18th, 2004 at 07:38 PM.
    Please support one of my projects?
    TKForums.com

    Web Forum
    JavaScript Wiki
    ________________________
    If somone helps you, please rate their post, by clicking the to rate their post

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    17
    ok but i don't think that will help. Becouse every tyme i refresh that HTML page the code line is diferent so i need to get the new line and use it.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    17

    new code

    <!-- building the clicklist for -1, user , timeout 63888 -->
    <!-- No ads because we are at number 1 out of 5 -->

    <script language="javascript">
    var myGlobalThis = this;
    var pret = false;

    img_ready = new Image();
    img_not_ready = new Image();
    img_ready.src = "http://www.darkthrone.com/templates/default/images/buttons/recruit1.gif";

    </script>

    <form name="pibm" action="recruitloop.dt" method="get">
    <input type="hidden" name="session" value="c20b0581ff6966d6d03372cc3c669b8d">
    <input type="hidden" name="alliance" value="-1">
    <input type="hidden" name="ticket" value="881651">
    <input type="image" style="border=0px;" name="nextimg" id="nextimg" onclick="return validate();" src="http://www.darkthrone.com/templates/default/images/buttons/recruit2.gif">
    </form>

    <script language="javascript">

    function ready() {
    pret = true;
    img_not_ready.src = document.getElementById("nextimg").src;
    document.getElementById("nextimg").src = img_ready.src;
    }

    function validate() {
    if (pret) {
    document.getElementById("nextimg").src = img_not_ready.src;
    }

    return pret;
    }

    setTimeout("myGlobalThis.ready()", 1000);

    </script>

    This is the new code i have to deal with.
    Now :
    value="c20b0581ff6966d6d03372cc3c669b8d"
    value="-1"
    value="881651"
    is always changing after i refresh the page so i need to get thouse values and put them in a strings and then i can make href by myself. I don't know how to open HTML code in my program so i will need that too!!!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    17

    I HOUND IT!!!!

    Ok i managed to make it work. Tnx for your help and this is my code :

    Private Sub Command1_Click()

    Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
    DoEvents
    Loop
    Text1.Text = WebBrowser1.Document.Forms(0).session.Value
    Text2.Text = WebBrowser1.Document.Forms(0).alliance.Value
    Text3.Text = WebBrowser1.Document.Forms(0).ticket.Value

    End Sub

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2004
    Posts
    17
    that code i use is working but it somethimes loads the first page i pasted and i cand get that href link.

    pls help me!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width