473,785 Members | 2,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is it possible to programmaticall y proxy a web request through c#?

I am trying to make a copy of all the files involved in a web request
from a specific website (i.e. you enter groups.google.c om, and hit
enter once and then basically make a copy of all the files involved in
loading that webpage).

At first I figured that I could do everything programmtically , (i.e.
open groups.google.c om in my c# app, and them loop through all the
hrefs and grab them one by one), but I would like to be able to write
an application which is browser independent. So in a sense, my
application would need to sniff out the files involved and copy them
to a local dir.

I have looked into packet sniffing, but that seems a little complex,
as I am not concerned with each individual packet, but rather each
individual file that is downloaded as a result of loading a web page.

Does anyone have any ideas? Also, I forgot to note, that I am rather
new to c#, so if there is some obvious way of implementing this, I
apologize in advance. Thanks!
Feb 5 '08 #1
1 2702
You are correct in your first approach. You need to download the HTML for a
page, then search the HTML for anchors, links, images, etc. and download
each of these independently. For each you will also need to review the
target URLs and make sure they are reset to look at your disk location
rather than the original site.

Additionally, you should review the use of robots.txt and the generally
accepted guidelines for creating robots (which is pretty much what you are
doing - creating a crawler). You should adhere to these rules to avoid
impacting the web sites of others. It would be very bad form to start
crawling somebody's web site as you could potentially adversely affect their
performance or cause errors for other visitors.

--

BlackWasp
www.blackwasp.co.uk
<dt*****@gmail. comwrote in message
news:d9******** *************** ***********@m34 g2000hsb.google groups.com...
>I am trying to make a copy of all the files involved in a web request
from a specific website (i.e. you enter groups.google.c om, and hit
enter once and then basically make a copy of all the files involved in
loading that webpage).

At first I figured that I could do everything programmtically , (i.e.
open groups.google.c om in my c# app, and them loop through all the
hrefs and grab them one by one), but I would like to be able to write
an application which is browser independent. So in a sense, my
application would need to sniff out the files involved and copy them
to a local dir.

I have looked into packet sniffing, but that seems a little complex,
as I am not concerned with each individual packet, but rather each
individual file that is downloaded as a result of loading a web page.

Does anyone have any ideas? Also, I forgot to note, that I am rather
new to c#, so if there is some obvious way of implementing this, I
apologize in advance. Thanks!
Feb 5 '08 #2

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

Similar topics

4
17737
by: Fuzzyman | last post by:
In a nutshell - the question I'm asking is, how do I make a socket conenction go via a proxy server ? All our internet traffic has to go through a proxy-server at location 'dav-serv:8080' and I need to make a socket connection through it. The reason (with code example) is as follows : I am hacking "Tiny HTTP Proxy" by SUZUKI Hisao to make an http proxy that modifies URLs. I haven't got very far - having started from zero knowledge of...
4
1640
by: Joel Cade | last post by:
I'm attempting to use an HTTP Module to monitor the progress of the request. Is there a way to do this? I've attempted to use the Request.TotalBytes property, and attempted to use the Request.InputStream, but both seem to only respond after the request has been sent to the server. Any help would be greatly appreciated.
2
1035
by: Rick | last post by:
Hi, 1) HelloWorld.aspx?productID=abc123 2) HelloWorld.cs calls the database and gets a block of HTML code: string dbReturned = "<body>Hello World, <a href=http://localhost/?productID={NEED TO GET FROM THE CURRENT REQUEST QUERY STRING}>click me</body>"
13
12412
by: trpost | last post by:
I am looking to make a small web app that will return the status of a website from the client browser. I tried this with AJAX and it worked great locally, but did not work for remote users accessing the page, I ran into the security problem with making a cross domain request. I have been reading that with JSON a cross domain request can be accomplished, but have not been able to find any examples on how to use it or how to get the return...
3
3083
by: itay_k | last post by:
Hi, I am running the following simple code (just open connection to some https page with proxy): proxy= '666.179.227.666:80' proxy=urllib2.ProxyHandler({"https":'https://'+proxy}) opener = urllib2.build_opener(proxy) request = urllib2.Request('https://somehttpspage....') response = opener.open(request)
3
2154
by: The Man From SQL | last post by:
Hi there, Here's the problem: our team is working on a web service which formerly took in two user defined types consisting of mostly simple datatypes. Recently we decided to move toward an XML schema to define the two types and the required values to submit rather than having to send .NET-specific types. So one of our team members generated an XSD with substantial annotation explaining to consumers of the web service what each element...
0
1140
by: paulshannon | last post by:
Hi All, We've been using Request.IsSecureConnection for some time to drop in and out of SSL for various sections of our web application. We have recently change server architecture though as we now accept all requests to our FreeBSD Apache cluster which then proxies the requests to the Windows Server. As the proxy request is done over plaintext HTTP the Request.IsSecureConnection no longer works correctly.
7
40979
by: chandru1782 | last post by:
Dear friends, I am trying to use CPAN for installing some perl modules. i am using a ubuntu system, which has internet connection through lan and authenticated proxy. when trying to install cpan.pm , it gives the following error, can any one help, You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one CPAN: LWP::UserAgent loaded ok Fetching with LWP:
1
2304
by: =?iso-8859-1?Q?David_S=E1nchez_Mart=EDn?= | last post by:
Hi! I've seen the message below in this python list, that seems to be unanswered. I'm trying to do the pretty same thing. There's a way to preprocess the request with a mod_python handler and then proxying it with mod_proxy?
0
9484
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10350
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10157
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9957
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8983
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5386
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4055
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3658
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2887
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.