hpple XpathQuery ideas? - html

I am using hpple to parse some HTML. I am using Xcode 4.6 and iOS 6.1. It looks like this.
I can extract the text and images by using the following XPathQueryStrings.
Text ==> //div[#class = 'entry-content']/p
Images ==> //div[#class = 'entry-content']//img/#src
However, I also need to get the text near the bottom "Retiring Stamp Set PDF". This text changes, but the format is usually the same. I tried the following path,
div[#class = 'entry-content']//a[#title]//text()
But that did not work. I am placing all these in an array and I can see that I get a null back for that entry, but I want to get the text. I looked at the XPath Syntax, but can't make it any further. Does anyone have any suggestions?

So I figured it out! So for anyone that has viewed this here is the answer according to my HTML file.
To get the text you use....
//div[#class = 'entry-content']//a[#title]//*
This returns all the text under the a div with a title.

Related

<br> does not break line in kableextra Rmarkdown HTML when there is a < character

So I have a tibble. assume that I have this string in a cell : cases(>20yo), cases(<20yo) other
I try cases(>20yo), cases(<20yo) <br> other . but other does not go to the next line in html output. it only works if I replace < in <20yo.
is there any reason behind this? how can I fix this. I am not bring the code since it does not show the output anyways and I assume this is a general question rather an a code specific. Thanks

Using Code <> As Actual Text

Really having trouble with this and can't find any results on it.
I want my html text to utilize the carrots <> for some of my text.
Specifically for a navbar menu item. But I can't seem to build it without activating the text as an actual div.
I want it to say "< Dev>" without using quotes or spaces, but it when I take the quotes/spaces away it activates it as a div. How do I keep the entire message "< Dev>" without turning it into a div item?
E.g:
<p> Welcome to my <Dev> portfolio</p>
Also what is the term used to override reserved code functions as text? Will help me research answers for other issues too. Like when using & as text and not as code.
Thanks for the assistance!
You'll want to use <p> Welcome to my <Dev> portfolio</p>
You can find a list of HTML character codes Here
Try using the html unicode values for those characters instead.
Welcome to my &60Dev&62 portfolio
Sorry it looks like this forum reads those unicode characters and prints them correctly. Add # signs at the after the & characters to get the html code.

Display text as html markup

I have a problem which is probably trivially easy but I can't seem to get it working. Using this post, I do a search using Regex in a text string to convert any links into html markup, but when it comes to display on the page it just displays like this:
this is link
<a href='http://www.google.com'>http://www.google.com</a>
In the view I have:
<p>#news.Body</p>
edit: great my question is now displaying how I want. So now to the actual question, how do I get the page displaying an actual link instead of the code when displayed to the user.
Use `` around your variable (e.g.)
Use "{}" icon in toolbar to insert code
Indent your code by one empty line, 4 spaces and leading empty line
E.g.:
Like this
You can edit this answer to see raw output

ruby tags for Sphinx/rst

I create HTML documents from a rst-formated text, with the help of Sphinx. I need to display some Japanese words with furiganas (=small characters above the words), something like that :
I'd like to produce HTML displaying furiganas thanks to the < ruby > tag.
I can't figure out how to get this result. I tried to:
insert raw HTML code with the .. raw:: html directive but it breaks my line into several paragraphs.
use the :superscript: directive but the text in furigana is written beside the text, not above.
use the :role: directive to create a link between the text and a CSS class of my own. But the :role: directive can only be applied to a segment of text, not to TWO segments as required by the furiganas (=text + text above it).
Any idea to help me ?
As long as I know, there's no simple way to get the expected result.
For a specific project, I choosed not to generate the furiganas with the help of Sphinx but to modify the .html files afterwards. See the add_ons/add_furiganas.py script and the result here. Yes, it's a quick-and-dirty trick :(

Flex4.6 StyleableTextField ignores <br> and <p> tags

I've got a StyleableTextField in my mobile project, which gets filled with html text using the .htmlText property.
The tag is working fine for me, but simple line breaks or paragraphs are simply ignored. What can I do about that?
Basically, the simplest HTML will just be displayed as a single line:
textField.htmlText = "<p>this should be the first line</p><p>this the second one</p>";
Again, the output is a single line.
The Flex 3 doc states that those tags are definitely supported, so I reckon they simply removed it in the newer versions (which is kinda ridiculous!).
I don't want to use the stagewebview, so what other ways to I have to properly format HTML using the StyleableTextField, or is there a simple replacement for the aforementioned tags?
Thank you very much guys!
Make sure that multiline is set to true, otherwise it will treat it as a single line of text, effectively ignoring the formatting.