|
-
Sep 18th, 2004, 07:02 PM
#1
Thread Starter
Junior Member
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&alliance=-1&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&alliance=-1&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!!!
-
Sep 18th, 2004, 07:31 PM
#2
Fanatic Member
use the Mid statment and the InStr Statment
Example:
VB Code:
Dim strHTMLcode as String, temp
temp = InStr(1, strHTMLcode, "href=" & Chr(34) & "http://www.darkthrone.com/recruiter/recruitloop.dt?session=5b87817b6aa7c090452aed479831a41f&alliance=-1&ticket=147630")
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"
'ADD 1 because of the " that is gone
Last edited by ALL; Sep 18th, 2004 at 07:38 PM.
-
Sep 19th, 2004, 05:27 AM
#3
Thread Starter
Junior Member
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.
-
Sep 19th, 2004, 05:47 AM
#4
Thread Starter
Junior Member
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!!!
-
Sep 19th, 2004, 05:58 AM
#5
Thread Starter
Junior Member
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
-
Sep 21st, 2004, 05:44 AM
#6
Thread Starter
Junior Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|