我知道这个问题听起来很可疑,但我处于一个奇怪的情况,我控制了一个项目,但构建网站的原始供应商保留了服务器和服务器端代码的所有权。
我通过Selenium成功地编写了很多与网站的交互,但我需要编写脚本的一个活动是通过Silverlight表单提交文件。 根据我的理解,你无法直接与Python或Selenium的Silverlight交互,但查看源代码看起来Silverlight只是用于获取文件位置并显示加载栏,实际的表单提交是通过post到ASP服务器端脚本完成。 但它有几个隐藏的验证字段。
所以我有点想象一个路径,我用Selenium导航到这个页面,然后解析该页面的验证值,然后提交包含这些值和我想要上传的数据的表单。
这种方法可行吗? 我在哪里可以找到类似这样的信息以及所涉及的困难?
I know this question sounds really suspicious, but I'm in a weird situation where I've taken control of a project, but the original vendor that built the website retains ownership of the server and the server-side code.
I've successfully scripted a lot of my interactions with the website through Selenium, but one of the activities I need to script is to submit files through a Silverlight form. From what I understand, you can't interact directly with Silverlight from Python or with Selenium, but looking at the source code it looks like the Silverlight is just used to get a file location and display a loading bar, and the actual form submission is done via post to an ASP server-side script. But it has several hidden validation fields.
So I'm kind of envisioning a path where I navigate to this page with Selenium, then parse that page for the validation values, and then submit the form with those values and the data that I want to upload.
Is this approach viable? Where can I find information on something like this and the difficulties involved?
最满意答案
Silverlight可以通过Windows辅助功能界面实现自动化。 这个范围对于stackoverflow帖子来说太大了,但我建议你看看这个: https : //msdn.microsoft.com/library/ms727247(v = vs.100).aspx
您可以使用UI Spy钻取以深入控制ID,然后使用Python的COM互操作来调用UI Automation API。
Silverlight can be automated via Windows accessibility interfaces. The scope of this is too big for a stackoverflow post, but I suggest you have a look at this: https://msdn.microsoft.com/library/ms727247(v=vs.100).aspx
You can drill use UI Spy to drill down to control IDs and then use Python's COM interop to call the UI Automation APIs.
更多推荐
发布评论