Source language: Translate to:

New Browser Actions

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

New Browser Actions

Postby datadon » Tue Jun 06, 2006 12:46 pm

Filling in a form with the new BrowserSetElement is easy and really great.
But finding out the name of the input field is not so easy unless you examine the source code.

I suppose we could extract the souce code and do some finds and string actions to extract the info. Before I do that....


My question is, is there an exsiting way to obtain the field names from a page in the browser object other than that?

Maybe someone has already grabbed this stuff before.

Any help or ideas is appreciated.
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas

Postby domino » Tue Jun 06, 2006 12:58 pm

I suppose we could extract the souce code and do some finds and string actions to extract the info.


For what it's worth that's how I normally do it...

Cheers
Dave
User avatar
domino
 
Posts: 275
Joined: Sat Apr 02, 2005 7:11 am
Location: Notts UK

Postby Gaev » Tue Jun 06, 2006 1:10 pm

Don:
My question is, is there an exsiting way to obtain the field names from a page in the browser object other than that?
... there is this thing called DOM (Document Object Model) ... and all sorts of DHTML that traverses the DOM-tree ...

- get the collection of form elements (usually just 1) in document
- for each form element, get field elements
- get details of each field (type, values etc.)

... but it can be quite complex to correctly extract everything in a generic fashion ... on the plus side, if MS security permits, you might be able to use the new BrowserExecScript to build such a query engine.
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby datadon » Tue Jun 06, 2006 2:01 pm

I guess for my application, which is just trying to see what the various name= items are so I can create BrowserSetElement actions. I can visuallly scan the source, but I often miss items. What I am planning on doing is to save the source to a temp file, read each line one at a time with a loop and if the string search finds the value it will append that line only to my viewing file. That way I know that each line has a name=
element.

Better than nothing.

You are right about a script might work, but beyond me for now.

I really would like to extract just the name=? and append it to a list.
At some future time I can create the code to get just the name=? part out of the line and into the list, but for now this works.

Anyone have any code on this to share would be great!

Thanks
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas

Postby datadon » Tue Jun 06, 2006 8:09 pm

If you use FireFox, here is a neat extension tool bar that has some really neat features.

One of note is the forms portion that shows all the name values for the forms right on the web page.

Far Out!!

https://addons.mozilla.org/firefox/60/
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas

Postby Neosoft Support » Wed Jun 07, 2006 1:53 pm

You can also do this:

1. Create a Web Browser object and set its URL to the HTML file you want to scan. This must be a local file.

2. Use the wizard NeoBook provides for the BrowserSetElement or BrowsergetElement actions.

3. In wizard's first parameter select the Web Browser object from step 1.

4. A list of elements found in the HTML file will appear in the drop down list for wizard's second parameter.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5593
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest