473,406 Members | 2,352 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,406 software developers and data experts.

Java script and screen scraping

Hi,

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"

However, 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?

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
Nov 19 '05 #1
2 6656
you need to look inside the <form name=login> tags to see all the required
field names. then you post to the
"/servlet/com.main.tmt.servlets.TmtLoginServlet" url. you will have to check
the cookies coming back for the login cookie.

-- bruce (sqlwork.com)
"Victor" <Vi****@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
Hi,

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"

However, 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?

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

Nov 19 '05 #2
Thank you for ypur response.

My URL is https://test.pls.com/login.jsp/

So, if I understood you correctly I should POST to https://test.pls.com
/login.jsp/servlet/com.main.tmt.servlets.TmtLoginServlet
with required field names such as user name and password.

Thanks again,
Victor
"Bruce Barker" wrote:
you need to look inside the <form name=login> tags to see all the required
field names. then you post to the
"/servlet/com.main.tmt.servlets.TmtLoginServlet" url. you will have to check
the cookies coming back for the login cookie.

-- bruce (sqlwork.com)
"Victor" <Vi****@discussions.microsoft.com> wrote in message
news:F6**********************************@microsof t.com...
Hi,

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"

However, 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?

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


Nov 19 '05 #3

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

Similar topics

4
by: Andy R. | last post by:
Hello everyone, I've spent quite some time now, looking for some information on how to get this done, sadly none has helped me much, though. I have a bit of java scrpt on a webpage (.php) to...
0
by: Robert Martinez | last post by:
I've seen a lot about screen scraping with .NET, mostly in VB.net. I have been able to convert most of it over, but it is still just very basic stuff. Can someone help direct me toward some good...
3
by: Jim Giblin | last post by:
I need to scrape specific information from another website, specifically the prices of precious metals from several different vendors. While I will credit the vendors as the data source, I do not...
0
by: Weston Weems | last post by:
If that java control has properties that are exposed to the browser, you should be able to use Javascript or VBScript to set hidden form field values to those values and submit them like normal. ...
4
by: rachel | last post by:
Hello, I am currently contracted out by a real estate agent. He has a page that he has created himself that has a list of homes.. their images and data in html format. He wants me to take...
4
by: onetitfemme | last post by:
Say, people would like to log into their hotmail, yahoo and gmail accounts and "keep an eye" on some text/part of a site .. I think something like that should be out there, since not all sites...
4
by: lucavilla | last post by:
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in...
4
by: different.engine | last post by:
Folks: I am screen scraping a large volume of data from Yahoo Finance each evening, and parsing with Beautiful Soup. I was wondering if anyone could give me some pointers on how to make it...
3
by: WFDGW2 | last post by:
I want to write or obtain C++ code that will scrape text from a dialog box within a poker client, and then record that text somewhere else. What do I do? Thanks.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
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
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...

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.