Welcome Guest Search | Active Topics | Sign In | Register

correct manner to work with htmlelements Options
BS
Posted: Thursday, November 14, 2019 3:07:28 PM
Rank: Newbie
Groups: Member

Joined: 11/14/2019
Posts: 3
Hi
i'm tryng to use your component to solve problems that have with others.

So, this is what i understood:
- It's necessary working with javascript
- I cant have reference object after executing script (all action need to be performed inside the script)

I usually work in two different steps
-get html element
-set its properties, ...click, ...etc
now, if i understood correctly, i have to do both inside the script


But ther'are some situations where some action depending on different conditions
that require working on htmlelement object,
How would i solve a situation like this:
- i get a htmlelement collection
- i scan the collection
- for every elements i check some conditions

var list=wb.getElementsByTag("DIV")
foreach (var hel in list)
{
if (( hel.outerHtml.IndexOf("XXX")>=0 ) &&
( mylist_saved_id.IndexOf(hel.id)<0 )
{
hel.click()
}
}

Some actions need to be handled "after" recovering the html elements,
but if i cannot have reference "after executing script" how would have to proceed?
eo_support
Posted: Friday, November 15, 2019 2:46:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

I do not understand what you meant by "some action need to be handled after recovering the HTML element". Specifically, which part of the source code you listed above can not be done in JavaScript?

Thanks!
BS
Posted: Friday, November 15, 2019 3:47:01 PM
Rank: Newbie
Groups: Member

Joined: 11/14/2019
Posts: 3
Hi, clearly you can do it in java script,
But prefer do not write all code in javascpipt for many reason.
More reasonable would be (for me) to use simple javascript to simple action, get html element and after use the htmlelent in my environment c# where I can access to my library, services, etc etc and more important it would allow me to save my interface (so I can switch webbrowser control, winform wpf gechofx, witouth difference).
Could you show me how to would write the example above?
Would you write all in a javascript function?
eo_support
Posted: Saturday, November 16, 2019 2:12:45 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi,

You will need to do it in JavaScript. We do not have any plans to implement such features outside of JavaScript. This page explains the key benefits of doing it this way:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsdom.aspx

We do not write JavaScript code for our customers either. We consider this general Web programming topic so you will need write/debug such code yourself. Sorry about it.

Thanks!
BS
Posted: Monday, November 18, 2019 5:02:08 AM
Rank: Newbie
Groups: Member

Joined: 11/14/2019
Posts: 3
Thank you
that is what i wanted to be confirmed.
I never wanted you write code for us, only understand how work your techonology
in order to choose the most suitable product for us.

BS


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.