nokogiri and the href label - ruby-on-rails

I am not sure how to access the label part of the anchor href tag. The other question that looks at this doesnt really answer it for me.
I have this code:
#name = page.css("#content").css("a")[1]
Which gives this result
generation xerox
I want to get at the "generation xerox" bit
I wouldnt mind getting at the href, I dont understand that either. I have read several other SO questions but I can't get it to work
Thanks in advance all

You can access the label with #name.text and the link with #name['href']
See doc

Related

Error: 'Imported XML Content cannot be parsed'

Here's what I'm doing:
=IMPORTXML("https://www.predictit.org/api/marketdata/markets/7164", "/MarketData/Contracts/MarketContract/ID")
The other answers I've seen about this have said that Javascript would be the issue, but the page in question seems to load without it, and I've tried using IMPORTJSON and IMPORTFROMWEB to no avail.
Please help!
You are input incorrect parameter for the xmlpath, a proper formula should be as following and you need to spend sometime to find the correct xmlpath to extract the specific string or information you want,
=IMPORTXML("https://www.predictit.org/api/marketdata/markets/7164","//a/#href")
Here is one example from Google:
=IMPORTXML("https://en.wikipedia.org/wiki/Moon_landing", "//a/#href")

How to insert an untitled hyperlink with RestructuredText?

With RestructuredText, I'd just like to insert a link where the address is the text of link. Like this: https://www.example.com/example-of-link.html
I just want the link to appear in the text, with no modification, no title, just the raw link. I can't find a way to do this. All the examples in the doc give titles to the links. Is there a way to do that?
Thanks for your help.
Ok, answering my own question: you just have to write the link and that's it, like this:
https://www.example.com/example-of-link.html
I always seem to forget that and I waste time searching for it. At least now the answer will be on Stackoverflow.

How to add PDF-Viewer Tab to Channel in Microsoft Teams?

Adding a PDF-Viewer tab to present/show a Sharepoint document has been working before.
I've tried this in January and it seemed to be an easy task - just get the DriveItem ID and URL (from GET /groups/{group-id}/drive/items/{item-id}) and edit the sample from the API Reference with these values (https://learn.microsoft.com/de-de/graph/teams-configuring-builtin-tabs#word-excel-powerpoint-and-pdf-tabs).
Now, that i want to use this, it doesn't work anymore ;-( The tab is created, added to channel, the name of the file shows BUT there is no document!!! What am i missing? Has the format changed? Has someone lately gotten this to work???
Please let me know, how! ;-)
ps: there is no description of the property "entityID" that makes any sense, can anyone explain it?
result in teams
Got the answer, was a Syntax problem!
The "contentURL" property needs to be unescaped (in this case the "%20"). It is that simple after all ;-)
Also i found out, the "entityID" property has no meaning for the File used. It can be "null" actually! I still use the ItemID i got from the DriveItem of the File.
For unescaping i used:
string contentUrl = Uri.UnescapeDataString(webUrl);
If it wasn't for this post I would have not gotten it figured out, so thank you!
For me I ended up having to make entityID null, just unescaping the contentURL didn't do it for me alone.
Thanks for your comment. leaving entityID null fixed my isse also.
I opend an issue to have the docs fixed!

How do I link to a LABEL in org-mode?

In org-mode, I have defined a figure+caption like this:
#+CAPTION: My great figure
#+LABEL: fig:myfigure
[[myfigure.png]]
How do I write "See figure [myfigure]"? I've found the following syntax:
See figure \ref{fig:myfigure}
but this looks ugly in the source file. In particular, you cannot use it for actually jumping to the figure.
You actually don't need '#+NAME', it works fine if you use '#+LABEL', which won't break your short-caption for list of figures.
Orgmode does now offer a 'jumpable', enumerated or link with name of your choice in the exported (latex, html) text if you link with:
see figure [[fig:myfigure]].
or
see figure [[fig:myfigure][figurenameintext]].
I would have added this as a comment, but I don't have the reputation yet.
--
In response to your comment (still can't comment): you do need the '#+NAME' for it to jump within the .org source file; as mentioned in the manual, and i also just confirmed that works. Not sure about the short-captions in the latest version.
With a very recent org-mode, you can use #+name:, see:
http://thread.gmane.org/gmane.emacs.orgmode/62644/focus=62646
#+CAPTION: My great figure
#+LABEL: fig:myfigure
#+name: fig:myfigure
[[test.png]]
See figure [[fig:myfigure][test]].
This works for me to jump from the link , but has no effect when exporting, I'm afraid...

Magento Categories URL

cant seem to find anything related to this on Google. Though maybe I’m not searching the right keywords.
On Magento 1.6 I have a category I created. For example, "test". The seo url for that would have been:
mysite.com/test/
I then deleted the category(stupidly) and later recreated it. Now the category is called:
mysite.com/test-1/
Is there any way to reset the internal index or something so that I can once again have the url:
mysite.com/test/
Hope that makes sense and someone can help.
Thanks a lot for reading.
have you tried to write "test" in the "URL Key" field ?
This behavior has something to do with the "redirect 301" flag.
Bye
Giuseppe

Resources