473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with getting data from a webpage

5 New Member
I am trying to write a javascript bookmarklet that will pull data from a webpage. The webpage in question comes pre-filled with info. I know what element and form numbers are tied to the field that I want to pull data from. How would I write a bookmarklet to harvest the data? The bookmarklet would be used in conjunction with a scripting program but I have a way to get the data from javascript into the script so don't worry about that part.

I have found this code elsewhere... it does what I need but it also provides too much info:
Expand|Select|Wrap|Line Numbers
  1. javascript:function ROIoiW(){var i=0,j,D,E,F=document.forms,DD="",m,M; while(i<F.length){E=F[i].elements;for(j=0;j<E.length;j++){ D=E[j];m=i+'/'+j+'/'+D.type+'-'+E.name+'-'+D.name+'-'+D.value+'\n'; M=M+m;DD=DD+m+'<br>'}i++} document.write(DD);}ROIoiW();void(null)
this displays form/element/description-value. All I need is a fucntion that will return a value for a specified form and element.

Can someone help please?
Jan 31 '08 #1
3 1362
acoder
16,027 Recognized Expert Moderator MVP
Welcome to TSDN!
All I need is a fucntion that will return a value for a specified form and element.
Expand|Select|Wrap|Line Numbers
  1. document.forms[specifiedForm].elements[specifiedElement].value;
Jan 31 '08 #2
erittaf
5 New Member
sweet! thanks a lot! works like a charm! I don't know javascript as well as i would like... sigh, all a matter of time
Jan 31 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
Glad it helped. If you want some good JavaScript tutorials/references, check out the Offsite Links sticky thread at the top of this forum.
Jan 31 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

12
2687
by: David Walker | last post by:
Hi I have a program which I need to interface with a webpage - the webpage will accept an input (probably a 'post' string from the program) and then will process it and needs to return a value. ...
3
1902
by: Joe | last post by:
Hi, I have written a webpage that allows a user to delete files in asp.net with I am having a small problem. To access this page a user has to login via login.aspx page. After successful...
2
1969
by: Steve K | last post by:
I got a bit of a problem I like some help on. I'm designing an online training module for people that work in food processing plants. This is my target audience. These workers have little or no...
53
2803
by: Paul Watt | last post by:
Hi again, Ok so I've got two new problems with this layout http://www.paulwatt.info/test/turn/ 1) When I increase the width of the Maincontent Div from 73% to 74% to line it up with the right...
8
3140
by: CM | last post by:
Hi, Could anyone please help me? I am completing my Master's Degree and need to reproduce a Webpage in Word. Aspects of the page are lost and some of the text goes. I would really appreciate it....
0
1296
by: =?Utf-8?B?UGllcmNlQnJvc25hbg==?= | last post by:
I am using C#(Vs.Net 2003) The error I am getting is... System.Xml.XmlException: This is an unexpected token. The expected token is 'EndElement' I have come to understand that this error is...
1
2453
by: oneski | last post by:
help --- 403 You don't have permission Im trying to get a basic search to work on my website, but i keep getting a forbidden error come up. Im using WAMP5 server on a vista machine. The error file...
18
3354
by: CenturionX | last post by:
Hello everybody, I'm using a webcontrol that gives me two probles: 1. I try to select an item in an html "select-one" control, i modify the value but it does nothing. When i navigate normally...
5
12791
sid0404
by: sid0404 | last post by:
Hi I am new to the visualstudio.net I am trying to develop an application which requires me to send data to a HTML webpage - http://patft.uspto.gov/netahtml/PTO/search-bool.html and the user...
0
7229
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
7333
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
7061
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
5637
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,...
1
5057
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
4716
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...
0
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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
769
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.