最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Scroll down to bottom of page with iMacros - Stack Overflow

programmeradmin0浏览0评论

I'm running an iMacro in Iceweasel (Firefox) on my Raspberry Pi. However, I can't seem to get it to scroll down to the bottom of the page. This is what I am currently using (and it isn't working):

TAG POS=1 TYPE=A ATTR=TXT:Your<SP>Tasks
URL GOTO=javascript:window.scrollBy(0,20000)

The first line of the code clicks a button in order to navigate to a new webpage. The second line is meant to scroll down to the bottom of the page, but doesn't.

I'm running an iMacro in Iceweasel (Firefox) on my Raspberry Pi. However, I can't seem to get it to scroll down to the bottom of the page. This is what I am currently using (and it isn't working):

TAG POS=1 TYPE=A ATTR=TXT:Your<SP>Tasks
URL GOTO=javascript:window.scrollBy(0,20000)

The first line of the code clicks a button in order to navigate to a new webpage. The second line is meant to scroll down to the bottom of the page, but doesn't.

Share Improve this question asked Feb 21, 2016 at 17:57 Isaac AdniIsaac Adni 8414 gold badges14 silver badges29 bronze badges 1
  • @freestock.tk I'm using iMacros and I'm on a Raspberry Pi... – Isaac Adni Commented Feb 21, 2016 at 18:05
Add a ment  | 

1 Answer 1

Reset to default 1

The trick is to set !WAITPAGECOMPLETE to YES and then use URL GOTO instead of just clicking on the button with TAG. This means that the new page will be loaded before the javascript is executed.

SET !WAITPAGECOMPLETE YES
URL GOTO=https://example.
URL GOTO=javascript:window.scrollBy(0,20000)
发布评论

评论列表(0)

  1. 暂无评论