No recent searches
Popular Articles
Sorry! nothing found for
Posted about 6 years ago by Graham Anderson
Hi. I'm trying to learn Scrapy-Splash. Within the below Splash lua script, the png returned does not show the updated element.
The javascript does work in Chrome Dev Tools.
Any push in the right direction is appreciated.
function main(splash, args) assert(splash:go("https://news.ycombinator.com/")) splash:runjs([[ el = document.evaluate('//b[@class="hnname"]',document, null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue; if (el != null) { el.textContent = 'Javascript Injection'; } ]]) return {png=splash:png()} end
0 Votes
thriveni posted almost 6 years ago Admin Best Answer
Hello,
I understand that there was a Support ticket for this issue and Javascript Injection can be done through splash through js_source https://splash.readthedocs.io/en/stable/api.html#executing-custom-javascript-code-within-page-context.
1 Comments
thriveni posted almost 6 years ago Admin Answer
Login to post a comment
People who like this
This post will be deleted permanently. Are you sure?
We use cookies to try and give you a better experience in Freshdesk.
You can learn more about what kind of cookies we use, why, and how from our Privacy Policy. If you hate cookies, or are just on a diet, you can disable them altogether too. Just note that the Freshdesk service is pretty big on some cookies (we love the choco-chip ones), and some portions of Freshdesk may not work properly if you disable cookies.
We’ll also assume you agree to the way we use cookies and are ok with it as described in our Privacy Policy, unless you choose to disable them altogether through your browser.
Hi. I'm trying to learn Scrapy-Splash. Within the below Splash lua script, the png returned does not show the updated element.
The javascript does work in Chrome Dev Tools.
Any push in the right direction is appreciated.
0 Votes
thriveni posted almost 6 years ago Admin Best Answer
Hello,
I understand that there was a Support ticket for this issue and Javascript Injection can be done through splash through js_source https://splash.readthedocs.io/en/stable/api.html#executing-custom-javascript-code-within-page-context.
0 Votes
1 Comments
thriveni posted almost 6 years ago Admin Answer
Hello,
I understand that there was a Support ticket for this issue and Javascript Injection can be done through splash through js_source https://splash.readthedocs.io/en/stable/api.html#executing-custom-javascript-code-within-page-context.
0 Votes
Login to post a comment