giovanii111
giovanii111

Reputation: 47

How to click element via Shadow DOM using VBA?

Having opened this link in Chrome, I get to the PDF file that opens in Chrome.
On this page there are buttons for downloading, printing, etc:
enter image description here

When viewing the page code, it does not display any information on the download and print buttons.
When I do view the code by hovering the mouse over the download icon, the code for this button opens, which is not available through a regular DOM.

As I understand it, you can use Shadow DOM here.

How do I access the download button and click it to the VBA? enter image description here

Upvotes: 0

Views: 577

Answers (1)

Peyter
Peyter

Reputation: 484

You could access the pdf by HTTP Request and save the data that way. The data is coming from the web, so it's going to be from a Request. You dont need chrome automated with VBA to do this action. Also Webdriver has good support: Downloading pdf file using WebRequests

idk if selenium has it, but i would search more if i were you and not use the DOM to download PDF by clicking elements.

Upvotes: 1

Related Questions