【问题标题】:I am getting "Unable to Parse Line" while trying to download the Excel file using AutoIT尝试使用 AutoIT 下载 Excel 文件时出现“无法解析行”
【发布时间】:2013-12-17 07:48:24
【问题描述】:

我在尝试使用 AutoIT 下载 Excel 文件时收到“无法解析行”。请找到相同的附加屏幕截图。找到下面我用过的代码。

;Exact location of WebSite from where we would like to download the file.We are 
reading url from commandline
$URL ="https://www.700creditsolution.com/dasdetail.aspx"

;Local address to which we would like to download the file
$filename = "C:\Users\Umamaheshwar\Downloads\scenario.xls"
WinActivate("[700CreditSolution]", "Export to Excel")
InetGet ($URL, $filename , 1, 0)
<span style="font-family: Times New Roman;"><span style="white-space: normal;">
</span></span>

我在 Webdriver 论坛中标记这个问题,因为使用 AutoIT 的人,但可能不是 AutoIt 论坛的成员。

请帮我解决这个问题。我们将不胜感激。

【问题讨论】:

  • 为什么您的 AutoIt 代码中有 HTML (&lt;span&gt;...&lt;/span&gt;)?

标签: excel selenium autoit


【解决方案1】:

在 autoit 中编译任何代码之前,您应该运行一个

SyntaxCheck by pressing CTRL+F5

它会检查你的代码语法并在有问题时提醒你。

【讨论】:

  • 感谢您的回复。我已经验证了语法检查并尝试下载文件,但它正在将登录页面内容下载到 Excel 文件。请帮我完成这个问题
  • 此网站是否需要您登录才能下载电子表格?如果是这样,您将不得不做的不仅仅是简单的 HTTP GET,因为 Web 服务器不会为您提供您可以在浏览器中访问的相同内容(在您通过身份验证之后)。不同站点的做法不同,但它们可能依赖于 cookie 或服务器端会话,而不仅仅是您的 IP 地址。如果你用 selenium 来做,你有更好的机会让它工作,但我不知道你为什么需要 AutoIt Selenium。硒应该足够了。
  • 首先,您的链接可能是错误的。当您手动下载它时,您可能会单击一个链接。复制该链接并将其放入 $URL。如果您的网站需要登录,您可以尝试myusername:mypassword@700creditsolution.com/…
  • 用真实数据替换 myusername、mypassword 和 path_to_my_download_file.xls。
  • 如果以上都不起作用,我建议您使用 IE.au3 UDF,因为在 aspx 页面上使用 WinHTTP.au3 对于初学者来说可能会很棘手。
猜你喜欢
  • 1970-01-01
  • 2013-05-31
  • 1970-01-01
  • 2016-06-25
  • 2020-01-02
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多