I am scraping a website with credentials and I have to click an element (button) that exports a pdf file (not as save as window).
The button directly exports the pdf file to C:\Users\User\Downloads
.
How can I change the directory to the desktop instead?
Also how to rename the file?
The code used to click this button
On Error Resume Next
Do While .FindElementByXPath("//*[@id='theBttnbobjid_1545645103945_dialog_submitBtn']") Is Nothing
DoEvents
Loop
On Error GoTo 0
.FindElementByXPath("//*[@id='theBttnbobjid_1545645103945_dialog_submitBtn']").Click
This is the html related to that button
<tbody><tr valign="middle"><td height="21" width="5" style="background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px 0px;"></td><td id="theBttnCenterImgbobjid_1545648005071_dialog_submitBtn" align="center" class="wizbutton" style="padding-left:3px;padding-right:3px;background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px -42px;"><nobr><a id="theBttnbobjid_1545648005071_dialog_submitBtn" href="javascript:void(0)" class="wizbutton" role="button">Export</a></nobr></td><td height="21" width="5" style="background-image:url('aspnet_client/system_web/4_0_30319/crystalreportviewers13/js/crviewer/../dhtmllib/images/skin_standard/button.gif');background-position:0px -21px;"></td></tr></tbody>