IMacros: Extract text from site - web-scraping

I need to extract to clipboard activation link, link every registration changed.
HTML Code:

Try something like this code:
SEARCH SOURCE=REGEXP:"(http://mctop.me/approve/\w+)" EXTRACT=$1
SET !CLIPBOARD {{!EXTRACT}}

Error -1200: parses "(http://mctop.me/approve/\w+)" - Unrecognized esc-sequence \w.

Related

I need to add price_scal and ads_scal to replace the hd_scal and ram_scal like the example says but it is not working?

This is what the example shows and I have to add price_scal and ads_scal to replace the hd_scal and ram_scal. I keep getting this error. How should I write it instead? I am new at R so any help would be much appreciated.
enter image description here](https://i.stack.imgur.com/PKv5o.png)](https://i.stack.imgur.com/PKv5o.png)

Get the text associated with a href element in a given page in scrapy

Currently my 'yield' in my scrapy spider looks as follows :
yield {
'hreflink':mylink,
'Parentlink':response.url
}
This returns me a dict
{
'hreflink':"https://www.southeasthealth.org/wp-content/uploads/Southeast-Health-Standard-Charges-2022.xlsx",
'Parentlink': "https://www.southeasthealth.org/financial-information-price-transparency/"
}
Now, I also want the 'text' that is associated with this particular hreflink, in that particular Parentlink. So my final output should look like
{
'hreflink':"https://www.southeasthealth.org/wp-content/uploads/Southeast-Health-Standard-Charges-2022.xlsx",
'Parentlink': "https://www.southeasthealth.org/financial-information-price-transparency/",
'Yourtext' : "Download Pricing Info"
}
What would be the simplest way to achieve that. I want to use Xpath expressions to get the "text" in a parentlink where href element = #href .
So far Here is what I tied -
Yourtext = response.xpath('//a[#href='+json.dumps(each)+']//text()').get()
but its not printing anything. I tried printing my response and it returns the right page - 'https://www.southeasthealth.org/financial-information-price-transparency/'
If I understand you correctly you want to get the text belonging to the link Download Pricing Info.
I suggest you try using:
response.xpath("//span[#class='fusion-button-text']//text()").get()
I found the answer to my question.
'//a[#href='+json.dumps(each)+']//text()'
This is the correct expression however the href link 'each' is case sensitive and it needs to match exactly for this Xpath to work.

Element locator with prefix 'xpath("//android.widget.edittext[#resourse-id' is not supported

I want to input username.
I have tried to find element as below using UIatomator but it throwing error.
Input Text xpath("//android.widget.EditText[#resourse-id='name']") test
I have attached screenshot for reference please help..please suggest
You are using the wrong syntax for xpath. The syntax is:
Input Text xpath=//android.widget.EditText[#resource-id='name']
The format is described in the Selenium2Library documentation, under the section "Locating or Specifying Elements"
Try like this:
xpath = "//*[#resource-id='name']/android.widget.EditText"
I believe it solves your problem.

How to break line in web page?

I want to format the content before showing to web page. I am storing '\r\n\' as enter in Database and trying to replace it before show content on the web page. server side my code is:
lblComments.Text = Server.HtmlEncode(((DataRowView)e.Item.DataItem).Row["Comment"].ToString().Replace("\r\n", "<br>"));
I have use Server.HtmlEncode.
My Out put should be:
Comment Type: Public
Comment: Commented on the Data by user A
But, its shows me everything in single line.
You need to use
.Replace("\r\n", "<br/>")
And only AFTER Server.HtmlEncode, because you don't want the <br/> itself to get encoded to <br/> (raw), displaying as <br/> literally.
You could wrap the output in a <pre>...</pre> element instead of replacing the line breaks with <br>. That way, the line breaks should be conserved.
E.g. put a <pre> element around your Label:
<pre><asp:Label id="lblComments" runat="server" /></pre>
Try
Replace("\n", "<br>")
This test worked without encode
string comments = #"Comment Type: Public
Comment: Commented on the Data by user A";
lblComments.Text = comments.Replace("\n","<br>");

How To convert Simple Word to Sphinx4 WSJ like Dictionary Prounounciation?

I Have Just Gone Through to this Sphinx4 Speech Recognition,I had implemented it with the helloworld demo of sphinx4,
Now What is Want is To create A dynamic dictionary For the text file given as input,
Right now What i need to do is just create a text file and uplaod in IMTOOLS and then They provide me a .Dict File.
But My requirement is like as the user Type any text in textbox and click a convert button then it automatically convert that word in to WSJ Dcitionary like prounounciation Words,\ E.G. User Type in textbox with the word he want to recognize Let say its a " ANKIT" then it automaticaly convert that word in to wsj dicionary like format as "AE NG K AH T" . please Anyone Can help me Out?or Any suggestion?i want to do That way...hope i explained in good way that you can understand in proper way and give me reply.. "
If any one Providing this service with the payment.then even its ok...
Here is an easy website that allows you to do that to create a .dic file: http://www.speech.cs.cmu.edu/tools/lmtool-new.html . Just upload a .txt file with what you would like to add to the dictionary. You can do this multiple times if you have more than a few thousand sentences and then converge them into one file.

Resources