PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 5.00 average.

Java script, screen scraping, WebClinet.UploadData

 
 
=?Utf-8?B?VmljdG9y?=
Guest
Posts: n/a
 
      2nd Nov 2005
Hi,

I posted this question previously and unfortunatly didn't get specific answer.

I have a problem with logging into web site via screen scraping. User name
and password field contain 'name' property, and therefore I can easily do
assignment to them: "userid=uidTest&password=pwTest"
User name and password are only required field names.

Submit button represented on page via hyper link:
<A href="javascript:login()" onBlur ="foc()"><IMG align=middle border=0
height=15 src="images/submit.gif" width=64></A>

Java script looks like this:
<script language=\"JavaScript1.2\">
function login()
{
document.login.method=\"post\";
document.login.action=\"/servlet/com.main.tmt.servlets.TmtLoginServlet\";
document.login.submit();
}
// end function
function foc() {
document.login.userid.focus();
}
</script>

How can I refer to it or invoke it?
For instance in case when I have html button with id btnSubmit and value
Submit, I would have following:
pParameters = "userid=uidTest&password=pwTest&btnSubmit=Submit";
_bParameters = Encoding.ASCII.GetBytes(pParameters);
_bResponse = _wc.UploadData(pURI, "POST", _bParameters);

I know that I have to post to the
"/servlet/com.main.tmt.servlets.TmtLoginServlet" url which mentioned in
JavaScript but what would be the syntax in c#?
Following is my c# code:
byte[] _bParameters = null;
byte[] _bResponse = null;
string _response = "";
pParameters = "userid=uidTest&password=pwTest"; // how to assign or execute
hyperlink?
_bParameters = Encoding.ASCII.GetBytes(pParameters);
_bResponse = _wc.UploadData(pURI, "POST", _bParameters);
_response = System.Text.Encoding.ASCII.GetString(_bResponse);

Thanks,
Victor

 
Reply With Quote
 
 
 
 
alex_f_il@hotmail.com
Guest
Posts: n/a
 
      3rd Nov 2005
You can try SW Explorer Automation
(SWEA)(http://home.comcast.net/~furmana/SWIEAutomation.htm). It allows
to create an automation API to any Web application. SWEA supports
frames, html dialogs, popup dialogs, java script and wil work from
ASP.NET. It allows visually extract a Web page data using XPATH. You
can write the screen scraping solution in hours.

Victor wrote:
> Hi,
>
> I posted this question previously and unfortunatly didn't get specific answer.
>
> I have a problem with logging into web site via screen scraping. User name
> and password field contain 'name' property, and therefore I can easily do
> assignment to them: "userid=uidTest&password=pwTest"
> User name and password are only required field names.
>
> Submit button represented on page via hyper link:
> <A href="javascript:login()" onBlur ="foc()"><IMG align=middle border=0
> height=15 src="images/submit.gif" width=64></A>
>
> Java script looks like this:
> <script language=\"JavaScript1.2\">
> function login()
> {
> document.login.method=\"post\";
> document.login.action=\"/servlet/com.main.tmt.servlets.TmtLoginServlet\";
> document.login.submit();
> }
> // end function
> function foc() {
> document.login.userid.focus();
> }
> </script>
>
> How can I refer to it or invoke it?
> For instance in case when I have html button with id btnSubmit and value
> Submit, I would have following:
> pParameters = "userid=uidTest&password=pwTest&btnSubmit=Submit";
> _bParameters = Encoding.ASCII.GetBytes(pParameters);
> _bResponse = _wc.UploadData(pURI, "POST", _bParameters);
>
> I know that I have to post to the
> "/servlet/com.main.tmt.servlets.TmtLoginServlet" url which mentioned in
> JavaScript but what would be the syntax in c#?
> Following is my c# code:
> byte[] _bParameters = null;
> byte[] _bResponse = null;
> string _response = "";
> pParameters = "userid=uidTest&password=pwTest"; // how to assign or execute
> hyperlink?
> _bParameters = Encoding.ASCII.GetBytes(pParameters);
> _bResponse = _wc.UploadData(pURI, "POST", _bParameters);
> _response = System.Text.Encoding.ASCII.GetString(_bResponse);
>
> Thanks,
> Victor


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ie crashes on a web page NO java or java scripts or java applets, on it!! mig30m6@hotmail.com Windows XP Internet Explorer 2 6th Aug 2005 03:58 AM
Help with Java - Sun Java runtime no Java VM Fredrick A. Zilz Windows XP Internet Explorer 3 8th Mar 2005 12:10 AM
java java java - UGGH BG Microsoft Frontpage 3 22nd Sep 2004 02:04 PM
Possible show other screen for "Installing your personal data" screen after the wellcome screen & before logon screen ? Pivert Windows XP Customization 2 18th Apr 2004 05:33 PM
java/ java script/ect help please ToughMC Windows XP Help 2 3rd Dec 2003 01:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:22 PM.