473,503 Members | 2,322 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 7599
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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:C4**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:9E**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
news:A6**********************************@microsof t.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****@discussions.microsoft.com> wrote in message
>> news:C4**********************************@microsof t.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
4975
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....
0
3198
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...
9
6779
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...
2
11888
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...
16
12610
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...
3
3121
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;...
0
2824
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...
0
1616
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
7554
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...
0
7207
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
7291
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,...
1
7012
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7468
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...
1
5023
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...
0
3180
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...
0
1522
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 ...
1
748
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
402
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...

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.