 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
Supish Expert Cheater
Reputation: 0
Joined: 08 Mar 2008 Posts: 157
|
Posted: Wed Jul 30, 2008 5:58 pm Post subject: [VB6] Inet Grabbing HTML Help |
|
|
Ok so I slapped this code together (copied and pasted a function).
| Code: |
Option Explicit
Private Function GetInBetweenAll(ByVal Start As Long, _
ByRef Expression As String, ByRef AfterWhat As String, _
ByRef BeforeWhat As String, Optional ByVal CompareMethod As VbCompareMethod = vbBinaryCompare) As String()
Dim lonPos As Long, lonE As Long
Dim strRet() As String, lonCount As Long
ReDim strRet(99) As String
lonPos = InStr(Start, Expression, AfterWhat, CompareMethod)
Do While lonPos > 0
lonPos = lonPos + Len(AfterWhat)
lonE = InStr(lonPos, Expression, BeforeWhat, CompareMethod)
If lonE > 0 Then
strRet(lonCount) = Mid$(Expression, lonPos, lonE - lonPos)
lonCount = lonCount + 1
If UBound(strRet) < lonCount Then ReDim Preserve strRet(0 To lonCount + 100) As String
Else
Exit Do
End If
lonPos = InStr(lonE, Expression, AfterWhat, CompareMethod)
Loop
If UBound(strRet) > lonCount And lonCount > 0 Then
ReDim Preserve strRet(0 To lonCount - 1) As String
End If
GetInBetweenAll = strRet
Erase strRet
End Function
Private Sub Command1_Click()
Dim strHTML As String
Dim strBold() As String
strHTML = Inet1.OpenURL("http://www.markisbleat.com/Maple-Story-players/Bera/Hermit/70/1")
strBold = GetInBetweenAll(1, strHTML, "title=" & Label1.Caption & "PM ", Label1.Caption & "><img", vbTextCompare) [b]'LABEL1.CAPTION is "[/b]
Dim l As Long
For l = 0 To UBound(strBold)
List1.AddItem strBold(l)
Next l
Erase strBold
End Sub
|
This all works...but when Inet1 opens the url its SUPPOSED to grab:
| Quote: |
<!DOCTYPE HTML PUBlIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
<head>
<base href="http://www.markisbleat.com/">
<meta name="description" content="Maple Story, Quests, Weapons, Skills, Guides, Buy and Sell">
<meta name="keywords" content="Maple Story, Buy, Quests, Weapons, Skills, Guides, Sell, Auction">
<link href="http://www.markisbleat.com/css.css?v=5" rel="stylesheet" type="text/css">
<link rel="search" type="application/opensearchdescription+xml" title="Maple Story Auction Search" href="http://www.markisbleat.com/basilmarket.xml">
<script src="http://www.markisbleat.com/functions.js" type="text/javascript"></script>
<script type="text/javascript">
function init() {
}
</script>
<script type="text/javascript" src="jq.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#nicemenu img.arrow").bind("mouseenter",function(){
$("span.head_menu").removeClass('active');
submenu = $(this).parent().parent().find("div.sub_menu");
if(submenu.css('display')=="block"){
$(this).parent().removeClass("active");
submenu.hide();
$(this).attr('src','img/arrow_hover.gif');
}else{
$(this).parent().addClass("active");
submenu.show();
$(this).attr('src','img/arrow_select.gif');
}
$("div.sub_menu:visible").not(submenu).hide();
$("#nicemenu img.arrow").not(this).attr('src','img/arrow.gif');
})
.bind("mouseenter",function(){ $(this).attr('src','img/arrow_hover.gif'); })
.bind("mouseleave",function(){
if($(this).parents('li').children("div.sub_menu").css('display')!="block"){
$(this).attr('src','img/arrow.gif');
}else{
$(this).attr('src','img/arrow_select.gif');
}
});
$("#nicemenu span.head_menu").bind("mouseenter",function(){ $(this).addClass('over')})
.bind("mouseleave",function(){
if($(this).next().css('display')!="block"){
$(this).removeClass('over')
}
});
$("#nicemenu div.sub_menu").bind("mouseenter",function(){ $(this).show();})
.blur(function(){
$(this).hide();
$("span.head_menu").removeClass('active');
});
$("#nicemenu div.sub_menu").bind("mouseleave",function() {
$("#nicemenu span.head_menu").removeClass('active');
$("#nicemenu span.head_menu").removeClass('over');
$("#nicemenu div.sub_menu").hide();
$("#nicemenu img.arrow").attr('src','img/arrow.gif');
})
$(document).click(function(event){
var target = $(event.target);
if (target.parents("#nicemenu").length == 0) {
$("#nicemenu span.head_menu").removeClass('active');
$("#nicemenu div.sub_menu").hide();
$("#nicemenu img.arrow").attr('src','img/arrow.gif');
}
});
});
</script>
It Stops grabbing the HTML after this point (</script>) so it doesn't get the part I want to parse
<title>Maple Story </title>
</head>
<body onload="init();" class="day">
<a name="menu_top"></a>
<div class="innerWrap innerWrapday">
And the rest of it doesn't matter...
|
Can anyone tell me how to make it grab the full html.
Or if theres a different way to grab ALL the html could someone post?
+rep to whoever helps
Oh and, I'm asking for help not criticism on my coding.
|
|
| Back to top |
|
 |
Orbit Advanced Cheater
Reputation: 0
Joined: 09 Dec 2007 Posts: 74
|
Posted: Wed Jul 30, 2008 9:43 pm Post subject: |
|
|
For VB.net the code is
| Code: | | TextBox1.Text = webbrowser.Document.Body.InnerHtml |
of course you need to add the webbrowser tool and open the url
try something like this in vb6
_________________
VB2008 Programmer  |
|
| Back to top |
|
 |
Supish Expert Cheater
Reputation: 0
Joined: 08 Mar 2008 Posts: 157
|
Posted: Thu Jul 31, 2008 9:51 am Post subject: |
|
|
| Orbit wrote: | For VB.net the code is
| Code: | | TextBox1.Text = webbrowser.Document.Body.InnerHtml |
of course you need to add the webbrowser tool and open the url
try something like this in vb6 |
Thank you
It works now.
+Rep
EDIT: Now I have a new problem.
How would I make the application wait for the webbrowser to finish navigating to the page?
EDIT2: Never mind got it to work with
Do Until InStr(WebBrowser1.Document.body.innerhtml, "urchinTracker();</SCRIPT>")
DoEvents
Loop
|
|
| Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Thu Jul 31, 2008 10:16 am Post subject: |
|
|
Use the WebBrowser1_Navigated event.
| Code: | Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
End Sub |
|
|
| Back to top |
|
 |
Supish Expert Cheater
Reputation: 0
Joined: 08 Mar 2008 Posts: 157
|
Posted: Thu Jul 31, 2008 10:19 am Post subject: |
|
|
| Typhoon808 wrote: | Use the WebBrowser1_Navigated event.
| Code: | Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
End Sub |
|
I don't think that works for vb6.
|
|
| Back to top |
|
 |
Typhoon808 Expert Cheater
Reputation: 0
Joined: 27 Mar 2008 Posts: 175 Location: Wales
|
Posted: Thu Jul 31, 2008 1:03 pm Post subject: |
|
|
Oh, my bad. It should be something very similar to that.
Try using the _DocumentComplete event.
|
|
| Back to top |
|
 |
Orbit Advanced Cheater
Reputation: 0
Joined: 09 Dec 2007 Posts: 74
|
Posted: Fri Aug 01, 2008 3:47 pm Post subject: |
|
|
This is the exact code you should have
| Code: | Private Sub Form_Load()
WebBrowser1.Navigate ("http://www.markisbleat.com/Maple-Story-players/Bera/Hermit/70/1")
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
TextBox1.Text = WebBrowser.Document.Body.InnerHtml
End Sub |
As the application starts in will navigate the webpage as its completed you will get the html code in textbox
_________________
VB2008 Programmer  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|