如何来与硒的webdriver使用C#滚动? [英] How to scroll down with Selenium WebDriver using C#?

查看:167
本文介绍了如何来与硒的webdriver使用C#滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在做一个谷歌文档的自动更新,我一直坚持了很多时间试图找出如何触发向下滚动电子表格,

I'm making an automated updater on a google docs and i've been stuck for many hours trying to figure out how to trigger a scroll down on the spreadsheet,

我也试过张贴在这里其他的解决方案
现在我想通过javascript来触发它,奇怪的是,它与其他的网站,但对于谷歌文档电子表格它不工作

i've also tried other solutions posted here right now i'm trying to trigger it through javascript, weird thing is that it works on other website but for the google docs spreadsheet it's not working

这是我在向下滚动代码:

here is my code on scrolling down:

js.ExecuteScript("window.scrollTo(0,Math.max(document.documentElement.scrollHeight," +
                    "document.body.scrollHeight,document.documentElement.clientHeight));");



我需要帮助,如果有提前

I need help if there's any other solution thanks in advance

推荐答案

虽然我硒的一个巨大的风扇,是不是真的用于更新谷歌文档电子表格的最佳工具?

While I am a massive fan of selenium, is it really the best tool for updating a Google Docs spreadsheet?

除非我正在为谷歌,我不会尝试自动执行此应用程序。

Unless I was working for Google, and I would not try and automate this application.

但是,由谷歌专门为访问提供的API电子表格;

However, there is an API provided by Google specifically to access spreadsheets;

https://开头开发商.google.com /谷歌应用程序/表格/

通过API去将远远快和可靠的。

Going via the API will be far faster and reliable.

这篇关于如何来与硒的webdriver使用C#滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆