The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> VB.NET DOM help for HTML
troyedwards
post Jul 20 2019, 10:35 PM
Post #1





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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>





Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Jul 20 2019, 10:50 PM
Post #2





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jul 21 2019, 12:43 AM
Post #3


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



What's the question?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Jul 21 2019, 04:13 AM
Post #4





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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.

This post has been edited by troyedwards: Jul 21 2019, 04:14 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jul 22 2019, 01:30 PM
Post #5


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Jul 23 2019, 04:08 AM
Post #6





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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


Attached File(s)
Attached File  Luwin_summary.txt ( 161.44k ) Number of downloads: 175
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jul 23 2019, 01:23 PM
Post #7


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jul 25 2019, 02:14 PM
Post #8


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Jul 29 2019, 04:17 AM
Post #9





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Jul 29 2019, 10:43 AM
Post #10


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



As I said, I will be happy to help you if you need it.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Sep 14 2019, 11:14 PM
Post #11





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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.


Attached thumbnail(s)
Attached Image
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Sep 15 2019, 12:49 AM
Post #12





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Sep 15 2019, 09:15 PM
Post #13


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
troyedwards
post Sep 18 2019, 06:11 AM
Post #14





Group: Members
Posts: 8
Joined: 20-July 19
Member No.: 26,938



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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
CharlesEF
post Sep 20 2019, 12:18 PM
Post #15


Programming Fanatic
********

Group: Members
Posts: 1,672
Joined: 27-April 13
From: Edinburg, Texas
Member No.: 19,088



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.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th October 2019 - 08:34 PM