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

Home Posts Topics Members FAQ

Enable script in HTTPWebRequest

Hi,
I am two days trying to solve a problem with some pages, which i get through
HTTPWebRequest. Error is that some pages need Script to be enabled. But how
to do this in HTTPWebRequest class?
Nov 19 '05 #1
7 7629
script is client code. when your code uses HTTPWebRequest, your code is the
client. the resest just returns the html, you need to write code to render
or run scripts. you could host the IE or mozilla active/x controls and use
them to render. neither are writen to be server based controls though.

-- bruce (sqlwork.com)
"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Hi,
I am two days trying to solve a problem with some pages, which i get
through
HTTPWebRequest. Error is that some pages need Script to be enabled. But
how
to do this in HTTPWebRequest class?

Nov 19 '05 #2
The first step to solving a problem is to define the problem clearly and
completely. It is not possible to proceed with a solution until this first
step is completed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Hi,
I am two days trying to solve a problem with some pages, which i get
through
HTTPWebRequest. Error is that some pages need Script to be enabled. But
how
to do this in HTTPWebRequest class?

Nov 19 '05 #3
Yes, thx for the lesson, exactly is something like this:

1. I need to download a page using HTTPWebRequest and than parse request;
2. Page requires to have Script enabled;
3. I suppose that script should be execute only after some user action (no
onLoad or else script).
4. So, for my purpose, for me is just enough if i can on someway simulate
than script is enabled, using HTTPWebRequest, to get full answer from site
(complete page)

"Kevin Spencer" wrote:
The first step to solving a problem is to define the problem clearly and
completely. It is not possible to proceed with a solution until this first
step is completed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
Hi,
I am two days trying to solve a problem with some pages, which i get
through
HTTPWebRequest. Error is that some pages need Script to be enabled. But
how
to do this in HTTPWebRequest class?


Nov 19 '05 #4
Hi gorkos,

I'm still having trouble understanding, but maybe it's a language barrier
thing. Let me try to ask a couple of questions.

1. You say you need to download a page using HTTPWebRequest. That's pretty
clear.

2. What do you mean by "Page requires to have Script enabled?" Apparently,
something is happening which seems to indicate this to you. What exactly is
it? What I mean is, an HTML document is a pretty straightforward text
document. All it contains is text. Any other resources in the page are
obtained via the browser making other requests, for images, other binary
resources, external scripts or stylesheets, etc. So, when you say "Page
requires to have Script enabled" I don't know what you're describing.

I get the feeling that you're trying to obtain something that is not IN the
HTML document you're requesting, but another resource that may be contained
in the page as a tag of some kind. But I can't tell for sure.

You also made some reference to some kind of "Error." Can you be more
specific about the nature of the "Error?"

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:A6******** *************** ***********@mic rosoft.com...
Yes, thx for the lesson, exactly is something like this:

1. I need to download a page using HTTPWebRequest and than parse request;
2. Page requires to have Script enabled;
3. I suppose that script should be execute only after some user action (no
onLoad or else script).
4. So, for my purpose, for me is just enough if i can on someway simulate
than script is enabled, using HTTPWebRequest, to get full answer from site
(complete page)

"Kevin Spencer" wrote:
The first step to solving a problem is to define the problem clearly and
completely. It is not possible to proceed with a solution until this
first
step is completed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
> Hi,
> I am two days trying to solve a problem with some pages, which i get
> through
> HTTPWebRequest. Error is that some pages need Script to be enabled. But
> how
> to do this in HTTPWebRequest class?


Nov 19 '05 #5
you need to figure out what the script does and emulate it. script can
change the UI, but for postback it generally only update the values of
postback fields (though its pretty easy to add postback fields in client
script, its not often done.)

you first need the parse the request response to get the form field names,
so you can build the postback name values pairs to emulate a submit. client
script normally only plays with the values of these fields.

for example to emulate a dropdown postback in asp.net (which uses client
script), you post the value of the selected value of the select, and
postback the id (after proper name munging) of the select in __EVENTTARGET
name pair.

-- bruce (sqlwork.com)

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:A6******** *************** ***********@mic rosoft.com...
Yes, thx for the lesson, exactly is something like this:

1. I need to download a page using HTTPWebRequest and than parse request;
2. Page requires to have Script enabled;
3. I suppose that script should be execute only after some user action (no
onLoad or else script).
4. So, for my purpose, for me is just enough if i can on someway simulate
than script is enabled, using HTTPWebRequest, to get full answer from site
(complete page)

"Kevin Spencer" wrote:
The first step to solving a problem is to define the problem clearly and
completely. It is not possible to proceed with a solution until this
first
step is completed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
> Hi,
> I am two days trying to solve a problem with some pages, which i get
> through
> HTTPWebRequest. Error is that some pages need Script to be enabled. But
> how
> to do this in HTTPWebRequest class?


Nov 19 '05 #6
Hi,
OK, again. I will try to be more clear.
1. I download the page with HTTPWebRequest, and I expect right data, which i
have when i use a browser, to parse some data from the page.
2. Answer from the page is (without HTML tags):

Please activate scripting
Scripting must be enabled before you can continue.
To enable scripting, you need to make a simple adjustment to your browser
settings.

Click here if you need more help with your browser.
After you have enabled scripting refresh this page.

3. I want to avoid this message and to collect data which i expect (like in
a browser)

"Kevin Spencer" wrote:
Hi gorkos,

I'm still having trouble understanding, but maybe it's a language barrier
thing. Let me try to ask a couple of questions.

1. You say you need to download a page using HTTPWebRequest. That's pretty
clear.

2. What do you mean by "Page requires to have Script enabled?" Apparently,
something is happening which seems to indicate this to you. What exactly is
it? What I mean is, an HTML document is a pretty straightforward text
document. All it contains is text. Any other resources in the page are
obtained via the browser making other requests, for images, other binary
resources, external scripts or stylesheets, etc. So, when you say "Page
requires to have Script enabled" I don't know what you're describing.

I get the feeling that you're trying to obtain something that is not IN the
HTML document you're requesting, but another resource that may be contained
in the page as a tag of some kind. But I can't tell for sure.

You also made some reference to some kind of "Error." Can you be more
specific about the nature of the "Error?"

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:A6******** *************** ***********@mic rosoft.com...
Yes, thx for the lesson, exactly is something like this:

1. I need to download a page using HTTPWebRequest and than parse request;
2. Page requires to have Script enabled;
3. I suppose that script should be execute only after some user action (no
onLoad or else script).
4. So, for my purpose, for me is just enough if i can on someway simulate
than script is enabled, using HTTPWebRequest, to get full answer from site
(complete page)

"Kevin Spencer" wrote:
The first step to solving a problem is to define the problem clearly and
completely. It is not possible to proceed with a solution until this
first
step is completed.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:C4******** *************** ***********@mic rosoft.com...
> Hi,
> I am two days trying to solve a problem with some pages, which i get
> through
> HTTPWebRequest. Error is that some pages need Script to be enabled. But
> how
> to do this in HTTPWebRequest class?


Nov 19 '05 #7
Hi gorkos,

What you posted is probably not the exact HTML in the page, as it does not
contain any tags. It would help if you posted the actual HTML you receive.
The reason is that there is probably a script in the page that writes out
the HTML you expect to see in a browser. You might also want to post the URL
to the page you are trying to parse, as this would help considerably. I
could look at the actual source code in the page and see your problem in a
heartbeat.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:9E******** *************** ***********@mic rosoft.com...
Hi,
OK, again. I will try to be more clear.
1. I download the page with HTTPWebRequest, and I expect right data, which
i
have when i use a browser, to parse some data from the page.
2. Answer from the page is (without HTML tags):

Please activate scripting
Scripting must be enabled before you can continue.
To enable scripting, you need to make a simple adjustment to your browser
settings.

Click here if you need more help with your browser.
After you have enabled scripting refresh this page.

3. I want to avoid this message and to collect data which i expect (like
in
a browser)

"Kevin Spencer" wrote:
Hi gorkos,

I'm still having trouble understanding, but maybe it's a language barrier
thing. Let me try to ask a couple of questions.

1. You say you need to download a page using HTTPWebRequest. That's
pretty
clear.

2. What do you mean by "Page requires to have Script enabled?"
Apparently,
something is happening which seems to indicate this to you. What exactly
is
it? What I mean is, an HTML document is a pretty straightforward text
document. All it contains is text. Any other resources in the page are
obtained via the browser making other requests, for images, other binary
resources, external scripts or stylesheets, etc. So, when you say "Page
requires to have Script enabled" I don't know what you're describing.

I get the feeling that you're trying to obtain something that is not IN
the
HTML document you're requesting, but another resource that may be
contained
in the page as a tag of some kind. But I can't tell for sure.

You also made some reference to some kind of "Error." Can you be more
specific about the nature of the "Error?"

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Ambiguity has a certain quality to it.

"gorkos" <go****@discuss ions.microsoft. com> wrote in message
news:A6******** *************** ***********@mic rosoft.com...
> Yes, thx for the lesson, exactly is something like this:
>
> 1. I need to download a page using HTTPWebRequest and than parse
> request;
> 2. Page requires to have Script enabled;
> 3. I suppose that script should be execute only after some user action
> (no
> onLoad or else script).
> 4. So, for my purpose, for me is just enough if i can on someway
> simulate
> than script is enabled, using HTTPWebRequest, to get full answer from
> site
> (complete page)
>
> "Kevin Spencer" wrote:
>
>> The first step to solving a problem is to define the problem clearly
>> and
>> completely. It is not possible to proceed with a solution until this
>> first
>> step is completed.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>> ..Net Developer
>> Ambiguity has a certain quality to it.
>>
>> "gorkos" <go****@discuss ions.microsoft. com> wrote in message
>> news:C4******** *************** ***********@mic rosoft.com...
>> > Hi,
>> > I am two days trying to solve a problem with some pages, which i get
>> > through
>> > HTTPWebRequest. Error is that some pages need Script to be enabled.
>> > But
>> > how
>> > to do this in HTTPWebRequest class?
>>
>>
>>


Nov 19 '05 #8

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

Similar topics

2
5033
by: Derek White | last post by:
Ok here's the deal. We are finally getting DSL again... but our PC is in the living room... and the youngest has figured out that if he hits the right keys... he can bring up Internet Explorer. All is fine and dandy right now, but come next week... that things wont be so dandy. I am setting our LInux router/server back up soon, and would like a quick, easy way to enable and disable our internet access. What I would like to do is have...
0
3222
by: Limey | last post by:
We are working with a vendor who is trying to post some some XML data to us. They are using an ASPX script to post to a PHP page of ours. The problem is that in the PHP page, I cannot find any kind of POST, GET or REQUEST data at all. Is there something that they or we are doing wrong? Is there somewhere else that PHP/Apache hide the data? The one thing I see in the PHP global variables that I don't understand is the...
9
6844
by: Wang, Jay | last post by:
Hello, all, I would like to enable some text between <SPAN url="http://www.testserver.com/">WORD TO BE DRAGGED </SPAN>. I put some javascript and it will extract http://www.testserver.com/ from the the span element when I select the whole text in the SPAN and drag it. However, I want to drag it without have to select the words between the span element. The default mouse action will only select the words when i move the mouse. Can...
2
11920
by: cotton_gear | last post by:
Hi, Depending on the user input I need to disbale/enable some of the links in my page. When disbled I need to display the links as normal text with cursor changed to mouse pointer style and when enabled I need to change it back to the normal link. I tried using document.getElementsById('myLink').style but I am getting 'Object doesnt support this property...' Can you suggest please ?
16
12647
by: thomas peter | last post by:
I am building a precache engine... one that request over 100 pages on an remote server to cache them remotely... can i use the HttpWebRequest and WebResponse classes for this? or must i use the MSHTML objects to really load the HTML and request all of the images on site? string lcUrl = http://www.cnn.com; // *** Establish the request
3
3131
by: mancha28 | last post by:
Hi, I would write the following code in C#. set objHTTP = CreateObject("Msxml2.XMLHTTP") objHTTP.open "POST", "http://url.com", False objHTTP.setRequestHeader "Content-Type", "text/xml; charset=utf-8" objHTTP.setRequestHeader "SOAPAction", "urn:blabla#ListOfTitles" objHTTP.send fullString
0
2842
by: deepak | last post by:
Hi All, i m develpoing a .net Window application which has 4 texboxes(tbxURLmfor URL in URL Frame,tbxAddress for address in Proxy server frame,tbxPort for port in proxy server frame,tbxProxyScript for proxy script in proxy script frame) and a test button..The requirment is given below STEP BY STEP GUIDE 1. Input the URL you want to test 2. Choose Proxy script/Proxy server with Address and Port Information/No proxy 3. Enter url to...
0
1638
by: alag20 | last post by:
Hi Guys, Can someone please help me with this wierd issue? I have a c# code below string lcUrl = "myscript.cgi"; // *** Establish the request
3
7576
by: daonho | last post by:
I have done ton of researches but haven't been able to find a the solution for this problem. I attempted to auto-login into facebook when the page is load. However, I kept getting the error "Cookies are not enabled on your browser. Please adjust this in your security preferences before continuing." Base on MSDN documentation, we can just enable cookie by creating the CookieContainer object; however, I am not so sure what else could have been...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10151
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
8973
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...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
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
4053
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
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
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.