Using the chrome helper HasElement method, but it always returns a false (element not present.)
Here is a simple html page:
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test</title>
</head>
<body>
<div class="col-sm-6" id="studies">
<h3>Clinical Studies</h3>
<p>Recent and current studies:</p>
<ul>
<li>In 2021, a study of a new drug for Crohn's disease.</li>
<li>(2022) A new drug for treatment of nonalcoholic fatty liver. Currently there are NO drugs approved for this condition.</li>
<li>We may be participating in a study of a new drug for hepatitis B.</li>
</ul>
<p>If you have one of these conditions and want to learn more about the studies, call our office and speak to Sameer.</p>
</div>
</body></html>
You can save it to a file as "test.html". Then this desktop program can be used to open it:
dim cp as helper::Chrome
cp.url="file://x:/test.html" ' or the path to the html you saved
dim dlg_title as c="HasElementTest"
dim dlg_body as c=<<%dlg%
{stretch=height,width}
{chrome=100,40cp};
<Close> <Check HasElement>
%dlg%
dim dlg_event as c=<<%code%
if a_dlg_button="Close" then
ui_modeless_dlg_close(dlg_title)
end if
if a_dlg_button="Check HasElement" then
found=cp.HasElement("studies")
ui_msg_box("div with id of 'studies' found",found)
end if
%code%
ui_dlg_box(dlg_title,dlg_body,dlg_event)
Pressing the "Check HasElement" button always comes up with "false" as he result.
Am I using HasElement the wrong way?
Here is a simple html page:
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test</title>
</head>
<body>
<div class="col-sm-6" id="studies">
<h3>Clinical Studies</h3>
<p>Recent and current studies:</p>
<ul>
<li>In 2021, a study of a new drug for Crohn's disease.</li>
<li>(2022) A new drug for treatment of nonalcoholic fatty liver. Currently there are NO drugs approved for this condition.</li>
<li>We may be participating in a study of a new drug for hepatitis B.</li>
</ul>
<p>If you have one of these conditions and want to learn more about the studies, call our office and speak to Sameer.</p>
</div>
</body></html>
You can save it to a file as "test.html". Then this desktop program can be used to open it:
dim cp as helper::Chrome
cp.url="file://x:/test.html" ' or the path to the html you saved
dim dlg_title as c="HasElementTest"
dim dlg_body as c=<<%dlg%
{stretch=height,width}
{chrome=100,40cp};
<Close> <Check HasElement>
%dlg%
dim dlg_event as c=<<%code%
if a_dlg_button="Close" then
ui_modeless_dlg_close(dlg_title)
end if
if a_dlg_button="Check HasElement" then
found=cp.HasElement("studies")
ui_msg_box("div with id of 'studies' found",found)
end if
%code%
ui_dlg_box(dlg_title,dlg_body,dlg_event)
Pressing the "Check HasElement" button always comes up with "false" as he result.
Am I using HasElement the wrong way?
Comment