473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Screen Scraping With VB.NET

What i wanted to do is make a webgame easyer, by getting
the page, and in stead of having multiple click actions,
make it all just 1 click and record stats for my profile.

For Example:

there is an arm wrestle part, you have to select oponent,
and click Challenge, because of the high traffic, once
you click challenge, the match is allready over, and u
have to refresh the page and try another.

The problem however is: when i make a webrequest, i only
get:
[Response]

<script type="text/javascript">
if (self.name != 'right')
top.location.replace('index.php');
</script>

<META HTTP-EQUIV="Refresh" CONTENT="0; URL=index.php"
TARGET="_top">

[/Response]

added a response bracket to show what i got from the page.

I wonder what headers i need to set to get the full page,
when i use IE, and do Show Source, i get much more (will
show in the bottom of the post.)

Here's the code i had to get the response:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Form1_Load(ByVal sender As System.Object,
  3. ByVal e As System.EventArgs) Handles MyBase.Load
  4. txtAW.Text = getpage
  5. ("http://www.bootleggers.us/index.php")
  6. End Sub
  7.  
  8. Private Function getpage(ByVal url As String) As
  9. String
  10. Dim awPR As System.Net.HttpWebRequest = CType
  11. (System.Net.WebRequest.Create(url),
  12. System.Net.HttpWebRequest)
  13. Dim awResp As System.Net.WebResponse
  14. awPR.Headers.Add("name", "right")
  15. Try
  16. awResp = awPR.GetResponse
  17. Catch ex As Exception
  18. MsgBox(ex.Message)
  19. Exit Function
  20. End Try
  21. Dim r As New System.IO.StreamReader
  22. (awResp.GetResponseStream())
  23. Dim strTmp As String = r.ReadToEnd
  24. r.Close()
  25. Return strTmp
  26. End Function
  27.  
  28.  
Thanx in Advance,

Nick

Response i should get:

<script type="text/javascript">
if (self.name != 'right')
top.location.replace('index.php');
</script>
<html>
<head>
<link REL="stylesheet" TYPE="text/css"
HREF="includes/main.css">
</head>
<body bgcolor=#333333>
<head>
<link REL=\"stylesheet\" TYPE=\"text/css\"
HREF=\"http://www.bootleggers.us/includes/main.css\">
</head>

<body topmargin=0>
<table width="100%" border=0 cellpadding=0 cellspacing=0
bgcolor="#5C5C5C">
<tr><td><img src="http://www.bootleggers.us/l.gif"></td>
<td width="100%"
background="http://www.bootleggers.us/m.gif"></td>
<td><img src="http://www.bootleggers.us/r.gif"></td>
</tr>
</table>
<br><br>

<center>
<table width=90% cellspacing=0 cellpadding=0 border=0>
<tr>
<td width=50% valign=top align=center>

<form method=post action=>
<table border=1 cellspacing=0 cellpadding=2
bordercolor=black width=90% class=sub2>
<tr>
<td class=header align=center colspan=3>Train</td>
</tr>
<tr>
<td class=header align=center>Activity</td>
<td class=header align=center>Rest</td>
<td class=header align=center>Gain</td>
</tr>
<tr>
<td width=50%><input type=radio name=train value=1> 10
Pullups</td>
<td>10 Mins</td>
<td>13%</td>
</tr>
<tr>
<td width=50%><input type=radio name=train value=2> 15
Dumbbells</td>
<td>5 Mins</td>
<td>7%</td>
</tr>
<tr>
<td width=50%><input type=radio name=train value=3> 25
Pushups</td>
<td>2 Mins</td>
<td>3%</td>
</tr>
<tr>
<td colspan=3 align=right><input type=submit
value="Work Out!"></td>
</tr>
</table>
</form>

<br>

<table border=1 cellspacing=0 cellpadding=2
bordercolor=black width=90% class=sub2>
<tr>
<td class=header align=center colspan=3>Current
Strength</td>
</tr>
<tr>
<td width=45%>Wins/Losses Ratio:</td><td>466:90</td>
</tr>
<tr>
<td width=45%>Current Level:</td><td>29</td>
</tr>
<tr>
<td width=45%>Percent to Next Level:</td>
<td>
<table border=0 cellspacing=0 cellpadding=0
width=100% class=sub2>
<tr><td width=36% bgcolor=green
align=right> </td><td>36%</td>
</tr>
</table>
</td>
</tr>
</table>

<br><br>

<form method=post action=>
<table border=1 cellspacing=0 cellpadding=2
bordercolor=black width=90% class=sub2>
<tr>
<td class=header align=center colspan=3>Create
Match</td>
</tr>
<tr>
<td>Bet:</td><td><input type=text name=matchbet></td>
</tr>
<tr>
<td> </td><td align=right><input type=submit
value="Start!"></td>
</tr>
</table>
</form>
</td>
<td width=50% valign=top align=center>

<form method=post action=>
<table border=1 cellspacing=0 cellpadding=2
bordercolor=black width=90% class=sub2>
<tr>
<td class=header align=center colspan=4>Current
Matches</td>
</tr>
<tr>
<td class=header align=center width=1%> </td>
<td class=header align=center>Opponent (W:L)</td>
<td class=header align=center>Bet</td>
</tr>
<tr>
<td width=1%><input type=radio name=challengematch
value="7470"></td>
<td><a href="viewprofile.php?
viewuser=Aronovic">Aronovic</a> (193:571)</td>
<td>$150</td>
</tr>
<tr>
<td width=1%><input type=radio name=challengematch
value="7471"></td>
<td><a href="viewprofile.php?
viewuser=luckchris">luckchris</a> (45:153)</td>
<td>$111</td>
</tr>
<tr>
<td width=1%><input type=radio name=challengematch
value="5531"></td>
<td><a href="viewprofile.php?
viewuser=Rikskie">Rikskie</a> (1421:110)</td>
<td>$1,624,032</td>
</tr>
<tr>
<td width=1%><input type=radio name=challengematch
value="7392"></td>
<td><a href="viewprofile.php?viewuser=swipe">swipe</a>
(2838:399)</td>
<td>$150</td>
</tr>
<tr>
<td colspan=4 align=right><input type=submit
value="Challenge!"></td>
</tr>
</table>
</form>

</td>
</tr>
</table>
</center><br><br><center>
<table border=1 cellspacing=0 cellpadding=2
bordercolor=black class=sub2>
<tr>
<td><b>Crew:</b> None</td>
<td><b>Rank:</b> Boss</td>
<td><b>Cash:</b> $333,161</td>
<td><b>Health:</b><td bgcolor=green width=100
align=center>100%</td><td class=sub2 width=0
align=center> </td></td>
</tr>
<tr>
<td colspan=2><b>Gun:</b> HighStandard .22 (0
Bullets)</td>
<td colspan=4><b>Protection:</b> None </td>
</tr>
</table>

<br>

<a
href="http://www.bootleggers.us/agreement.php">Terms of
Service</a>
</center>
Nov 20 '05 #1
1 3407
i only added this below here, to try if that made anny
difference, but as u might be able to tell, i am kindda
lost...
awPR.Headers.Add("name", "right")
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jonathan Epstein | last post by:
I would like to perform a more classical type of "screen scraping" than what most people now associate with this term. I only want to find all the text on the current screen, and obtain associated...
4
by: Roland Hall | last post by:
Am I correct in assuming screen scraping is just the response text sent to the browser? If so, would that mean that this could not be screen scraped? function moi() { var tag = '<a href='; var...
2
by: Me | last post by:
I am dealing with a poorly written windows application that does not contain an API. I would like to use C# to run a predetermied set of steps in the application and scrape the resulting data...
0
by: Robert Martinez | last post by:
I've seen a lot about screen scraping with .NET, mostly in VB.net. I have been able to convert most of it over, but it is still just very basic stuff. Can someone help direct me toward some good...
3
by: _eee_ | last post by:
Does anyone know of a simple code module that can do screen scraping, including simulating user-entered pushbuttons, etc. I can get the first screen on a website with HttpWebRequest, but I need...
3
by: Jim Giblin | last post by:
I need to scrape specific information from another website, specifically the prices of precious metals from several different vendors. While I will credit the vendors as the data source, I do not...
1
by: niv | last post by:
Hello, I would like to screen scrape certain parts of a webpage...how can I do this in asp.net For instance.... a stockticker thats embeded on a webpage.. I dont want the entire page.. I...
4
by: rachel | last post by:
Hello, I am currently contracted out by a real estate agent. He has a page that he has created himself that has a list of homes.. their images and data in html format. He wants me to take...
4
by: different.engine | last post by:
Folks: I am screen scraping a large volume of data from Yahoo Finance each evening, and parsing with Beautiful Soup. I was wondering if anyone could give me some pointers on how to make it...
3
by: WFDGW2 | last post by:
I want to write or obtain C++ code that will scrape text from a dialog box within a poker client, and then record that text somewhere else. What do I do? Thanks.
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.