Help - Search - Members - Calendar
Full Version: VB.NET DOM help for HTML
HTMLHelp Forums > Web Authoring > General Web Design
troyedwards
Hi guys we have to log in to bank account every day and either print off 1 page of our bank statement OR save the statement to CSV. I am trying to automate this process such that when our managers come in the 1 page bank statement has already by printed and is sitting on the printer (and we have saved the day to CSV).

There are no APIs that I can get hold off atm, so I am using VB.NET and the DOM. I can automate the login process, and select a specific bank account however some of my managers have access to several business known as different bank profiles. Basically I need to know how to select a specific value in the combo box however in the HTML its not a <SELECT> tag. Instead the banks uses profilelistview and each of the business's have a unique profile id, ie data-profileId="6767901001620df51020114442000005". I can drill extract this profile id but I don't know how to pass it. Its not like ?data-profileId="6767901001620df51020114442000005


<li id="Administration.CustomerProfile.GetAllProfilesWidget">
<div id="widget-222a94daa40b4845ab2b6171cceba92a" class="widget administration-customerprofile-getallprofileswidget" data-selected-profile-id="&quot;6767901001620151020114442000005&quot;" data-select-customer-profile-action="https://banking.westpac.com.au/secure/banking/authentication/profileswitch" data-set-flyout-visibility-cookie="https://banking.westpac.com.au/secure/banking/firstsignin/setflyoutvisibilitycookie" data-profile-list-view-url="https://banking.westpac.com.au/secure/banking/overview/profilelistview" data-verifycustomerprofile="https://banking.westpac.com.au/secure/banking/administration/verifycustomer" data-switchtosuspendedprofilemessage="The profile you're trying to access has been suspended. Please select another profile or call us on 1300 655 505 for help." data-limitedaccessprofileswitchmessage="This profile is inactive or outside allowable access days. Please contact your Administrator for access." data-isemulationmode="False" data-analytics-nav="col-main">


<div class="administration-customerprofile-getallprofileswidget flyout-cell flyout-cell-open">
<a id="profile-switch-flyout" href="#" class="flyout-menu-toggle btn btn-small">LUWIN INVESTMENTS PTY LTD - Business banking
<span class="a11y-context">Click to open profile</span>
<img src="https://banking.westpac.com.au/secure/banking/Themes/Default/Desktop/WBC/Core/Images/Patterns1.1/icon-menu-arrow-down.png.d857629e7141d53add72b4707cbe5df6fec017d6.png" alt="" />
</a>


<div class="flyout-below flyout flyout-menu"> <div class="customer-action-flyoutwrapper">
<ul class="flyout-menu-list">
<li>
<div class="selected-profile-item"
data-profileId="6767901001620df51020114442000005"
data-isPersonalProfile="False"
data-profileName = "MY COMPANY PTY LTD"
data-profileType="Business banking"
data-isActivationRequired="False"
data-isAccessibleToday="True"
data-isExpired="False"
data-accessPeriod=""
id="67679010016201510254314442000005">
<span class="flyout-menu-heading">MY COMPANY PTY LTD</span>
<span class="flyout-menu-item">Business banking</span>

</div>



troyedwards
I wonder …

I see this link https://banking.westpac.com.au/secure/banki...profilelistview


and then this HTML

<a href="#" data-profileId="6767901001620150806101011000004" data-isPersonalProfile="False" data-profileName="DAKABIN INVESTMENTS PTY LTD" data-profileType="Business banking" data-isActivationRequired="False" data-isAccessibleToday="True" data-isExpired="False" id="6767901001620150806101011000004" class="flyout-link-white-bg profile-list"> <span class="flyout-menu-heading">DAKABIN INVESTMENTS PTY LTD</span>
<span class="flyout-menu-item">Business banking</span>
</a>
CharlesEF
What's the question?
troyedwards
Hi Charles - I am trying to select a business profile in the Combobox. So currently the profile is set to Luwin Investments. I want to select another business profile programmatically via my vb.net webbrowser1 and the DOM components.
CharlesEF
QUOTE(troyedwards @ Jul 21 2019, 04:13 AM) *

Hi Charles - I am trying to select a business profile in the Combobox. So currently the profile is set to Luwin Investments. I want to select another business profile programmatically via my vb.net webbrowser1 and the DOM components.
Well, you don't show any code for a combobox (select?), all you showed was a link. Helping with the HTML is not a problem but all those data attribute values would depend on your application code. I would need to see that code (.asp page?) to be sure I don't mislead you.
troyedwards
Thanks Charles I have attached the page summary as an attached text file.

Currently the page shows me the profile for LUWIN. It looks like the webpage uses some sort of "flyout-below flyout flyout-menu" not a combo box ????

In the combo box I have several selections which are LUWIN, Personal, DAKABIN, ELLENGROVE, NEO. I want to be able to programmatically select NEO as an example.

I note in the HTML for NEO the following below. It looks like the profile is assigned a temp profileID, ie 6767901001620150725230732184506, but again not sure how to select sad.gif

<a href="#" data-profileId="6767901001620150725230732184506" data-isPersonalProfile="False" data-profileName="NEO" data-profileType="Business banking" data-isActivationRequired="False" data-isAccessibleToday="True" data-isExpired="False" id="6767901001620150725230732184506" class="flyout-link-white-bg profile-list"> <span class="flyout-menu-heading">NEO</span>
<span class="flyout-menu-item">Business banking</span>
</a>



Thanks for taking the time to help me mate.
Troy
CharlesEF
Just to be sure, you want to be able to change the 'combobox' (uses CSS for this) and have the page reload with the new combobox selection ready to use. Is this correct?
CharlesEF
Sorry for the delay, had a job to take care of. Anyway, I've started to look over the code, almost 1900 lines. I'm not sure I can help to be honest. This forum provides free help but your request goes beyond this scope.

If you start to edit your code and need help then post back.
troyedwards
Hi Charles - sorry for delay - busy with work.

The answer to your question is yes I just want to change a value in the combo box (using VBnet code) but not sure how. I don't think I can use the normal Option select.

The 1900 lines of code is not my code. It is a dump of the website which I am trying to manipulate via a VBnet webbrowser control
CharlesEF
As I said, I will be happy to help you if you need it.
troyedwards
Hi Charles not sure if you are still following this thread but would love any insight you have as I still have this problem. Just for clarification I can programmaticaly get to the the web page where I need to make a selection of bank profile. However once I get there and I "view source code" I cannot find a unique href which will take me to one of the accounts. What I see is <a href="#" data-profileId="6767901" which tells me that the data-profileId is what I require to get to page I want. I just don't know how to pass this variable in, as in the obvious https://banking.westpac.com.au/secure/banki...t;6767901" does not work. So maybe the data-profileId is pass in POST parameters ?????

I have attached the page where I am stuck at. Also that 1900 lines of code is simple the "View Source" code of the actual web page which I am trying to manipulate.

Again thanks for helping.
troyedwards
Adding to my last post I believe the answer is that I have to use a POST via the web browser control - ie

WebBrowser1.Navigate URL, Flags, TargetFrame, PostData, Headers
CharlesEF
As far as I know, data attributes are not passed when you submit a form. The only way I know of is to place a hidden input element in the form and use Javascript to set the value of that element. When you set that value depends on you. You could use an onchange or onblur event to fire Javascript to set the hidden element value. Or, maybe you could add the logic to your validation process? Or maybe the onsubmit event. If you have a AJAX call maybe you don't need to set any hidden elements. You just use Javascript to set the name/value pair for each data attribute you need.
troyedwards
Thanks Charles. I pulled up the webpage in EDGE and the actual link that I want to press programatically ie with a vb call WebBrowser1.Navigate "www.etc" is

<a class="link-red" href="#" data-s-object-id="https://banking.westpac.com.au/secure/banking/overview/profilelistview_11" data-bind="click: function(data, event) {$root.switchProfile($data, event)}">View accounts</a>


If i try and navigate to "https://banking.westpac.com.au/secure/banking/overview/profilelistview_11" then I get an error and the bank won't allow me to go further. So i need to get the element and force a click but I do not now how to pass any data to the javascript click function sad.gif
CharlesEF
I've looked over the 1900 lines of code but I don't see what I'm looking for. There must be some kind of event listener to catch click events. The link you posted will not work as a stand alone link. All the required information is stored in data attributes. I've not written code of this type (because it's a bank?) so I'm not sure. If you had a event listener defined for 'a' links then the listener code could get all the data attribute info needed. Sorry I can't be of more help.
Ivy Crawford
Hi there! Never had experience in coding for a bank, I looked through the code (1900 lines is too much, actually...), but still, I didn't really get what I was looking for, unfortunately, can't help much.. But as CharlesEFsaid, the link which you posted won't work as a stand-alone link.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2019 Invision Power Services, Inc.