我正在尝试从具有几个窗口的SharePoint网站中抓取数据。显然,所有数据都必须可见才能刮取(JavaScript)。我试图弄清楚如何在窗口中向下滚动并同时抓取数据。该窗口标识为:
<div class="md-virtual-repeat-offsetter" role="presentation" style="transform: translateY(0px);">
当我在此窗口中向下滚动时,translateY(0px)
会这样增加:32px,64px,96px等,直至31250px。如何增加像素数并在此窗口中抓取所有HTML元素?我认为代码应该是这样的。
#first move to the element
wd.execute_script('window.scrollTo(0, arguments[0]);', scroll_size)
#then scroll by x, y values, in this case 10 pixels up
wd.execute_script('window.scrollBy(0, 10000);')
但是,当我运行该命令时,什么也没发生。