Answer the question
In order to leave comments, you need to log in
How to get javascript code from html page using xpath in php selenium?
Installed selenium and phpwebriver. Next
, it turns out to find buttons and click on them, enter authorization data and other
$driver->findElement(
WebDriverBy::XPath("//button[contains(.,'Not now')]"
) javascript to extract the data of the array that is in it and work further.Here
is an example of a script.
<script type="text/javascript">window._sharedData = {"config":{"csrf_token":"vtM7sTGpo88terBmDtRp6MEMeFUEDOP3","viewer":{"video_view_count":70923б, и дальше много чего ;</script>
<link rel="stylesheet" href="/static/bundles/es6/ConsumerUICommons.css/22bdac298a9e.css" type="text/css" crossorigin="anonymous" />
<link rel="stylesheet" href="/static/bundles/es6/Consumer.css/4f1dc2dd323d.css" type="text/css" crossorigin="anonymous" />
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question