Python下载亚马逊发票

时间:2020-06-09 06:40:33

标签: python selenium

我正在尝试下载亚马逊“我的订单”表格上的所有发票。页面上的每个发票都隐藏在一个小的弹出窗口中,如下所示:

<a href="javascript:void(0)" class="a-popover-trigger a-declarative"> Factura <i class="a-icon a-icon-popover"></i></a>

这会在一个小框中显示一些链接选项,我要下载的链接看起来像这样:

<span class="a-list-item">
<a class="a-link-normal" href="https://longdownloadhyperlink"> Factura 1 </a> 
</span><span class="a-list-item">

我尝试使用Selenium来单击弹出框,或者找到无用的正确链接。示例:

fact = driver.find_element_by_xpath('/html/body/div[5]/div/div[1]/div/ul/li[2]/span/a')

发生“无法找到元素”错误。

0 个答案:

没有答案