scrape the data-title and data-video-id on single page - scripting

I want to scrape the data-title and data-video-id but i don't know how to write the script with imacros
The Photos

Try this:
SET !EXTRACT_TEST_POPUP NO
TAG POS=1 TYPE=TR ATTR=CLASS:pl-video<SP>yt-uix-tile* EXTRACT=HTM
SET data-title EVAL("'{{!EXTRACT}}'.match(/data-title=\"(.*?)\"/)[1]")
SET data-video-id EVAL("'{{!EXTRACT}}'.match(/data-video-id=\"(.*?)\"/)[1]")
SET !EXTRACT {{data-title}}[EXTRACT]{{data-video-id}}
PROMPT {{!EXTRACT}}

Related

How to get the whole element with Kantu Selenium IDE?

Method storeAttribute works perfectly when I need to get an attribute like href:
xpath=(//span[#class='active'])#href
But how should I use it to get the whole element (span in this example)? I mean the whole html source text of the element.
You can do this just with the storeText command.
So your target would be just:
xpath=(//span[#class='active'])
Set Command to storeText and set Value to the name of the desired variable.

Count tags in web page HTML code

How i can count number of tags in HTML web site code?
I try to use this code:
f=ie.document.getElementsByTagName("p")
MsgBox f.count
But it does not work
$("p").length
If you want to count tags in html page use jquery ".length" it gives you length of the all tags in html page.
Use length property of javascript or if f is an vba's array use this https://msdn.microsoft.com/fr-fr/library/system.array.length(v=vs.110).aspx

how to set meta tag dynamic from database in mvc

ViewData["ChildPageMetaConent"] = lstPageMetaContentChilds; // from this line i get data from database and set to ViewData .
Example : in ViewData["ChildPageMetaConent"] have list class. You can check in Image.
And on Master.cshtml I am accessing ViewData["ChildPageMetaConent"] variable and gointo to write on
page but its print on page like a text .
And on HTMl its look like this :
I got the Answer.
Need to Use #Html.Raw(string)
so it print exact html tag on page.

How can I get the text from a simple HTML tag using Selenium RC?

How can I get the text from a simple html tag
<h2>ABCDEF</h2>
using Selenium RC?
I want to match the exact text. If I use isTextPresent() it returns true even if I put selenium.isTextPresent("ABC").
This is in a HTML tag <h2>.
Then you need to do the following
strText = selenium.getText("//h2")
if strText.equals("ABCDEF")
System.out.println("TextMatch")
else
System.out.println("Text Mismatch")

How update a parameter via Javascript in CDE

I'm trying to create an interactive dashboard with CDE and I would like a parameter to be set
when I click on the element of a treemap.
I've created a parameter and can display (via a text component), I also wrote a clickAction which display the desired value I want to set to the parameter. The question is, how do I set the parameter ?
Easy, simply:
Dashboards.fireChange('paramname', paramvalue);