473,241 Members | 1,617 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,241 software developers and data experts.

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 7573
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
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
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
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
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
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
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
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
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
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
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.