MySQL removing HTML hyperlinks while keeping name of link - html

So I'm trying to do the following:
A column in my table contains a bunch of text, amongst which is --
<a href="random.website.com>Text I want to keep</a>
which I want to change to:
Text I want to keep
Do also note that "random.website.com" is basically unique for each item, i.e.: it contains a different link for each item.
I am aware that there is a third party UDF called REGEXP_REPLACE but this is not available for me to use.
Is there any other to accomplish this? Appreciate any help of course.
Regards

Related

How to select all elements with a specific name under every li node with the same structure?

I have a certain bunch of XPath locators that hold the elements I want to extract, and they have a similar structure:
/div/ul/li[1]/div/div[2]/a
/div/ul/li[2]/div/div[2]/a
/div/ul/li[3]/div/div[2]/a
...
They are actually simplified from Pixiv user page. Each /div/div[2]/a element has a title string, so they are actually artwork titles.
I want to use a single expression to fetch all the above a elements in an WebExtension called PageProbe. Although I've tried a bunch of methods, it just can't return the wanted result.
However, the following expression does return all the a elements, including the ones I don't need.
/div/
The following expression returns the a element under only the first li item.
/div/ul/li/div/div[2]/a
Sorry for not providing enough info earlier. Hope someone can help me out. Thanks.
According to the information you gave here you can simply use this xpath:
/div/ul/li/div/div[2]/a
however I'm quite sure it should be some better locator based on other attributes like class names etc.

Google Sheets - Fill multiple rows with different values

I am trying to enter multiple values to another column however It seems to be harder than I thought even that or I have no idea what I am doing, Is there an easier way to add different values to a different columns?
Example:
<span class="question" id="" onclick="expand('A101')" - On the ID="" Element I want to add different values like this: <span class="question" id="Q101" onclick="expand('A101')" however the Q/A 101 will go upto 327. (So from A101 to A327 and Q101 to Q327)
I have been looking for the past day on trying to do this without it pasting everything into one cell. I have even tried doing it Visual Studio but cannot seem to find a way other than manually entering them. As you can see from the image below, I am trying to add matching values in the Question and Answer elements. Same will go for the p tags because I want to add 1 answer to each element but they will need to be different. Do I have to do this manually?
Example Image of the code.
Here is my solution:
https://docs.google.com/spreadsheets/d/1Xvre3UPegHlZATzYn68lw11NYRv9sfg1v6Lfzzie5NU/copy
You need to cut it into pieces - parts that are used just as plain text and variables that change.
Then you combine cells using join() function and empty delimiter "".
Id this what you were looking for?

Xpath with wildcards between id and divs?

I try to enter data in a table using Robot Framework. The table has an ID, but it changes every time I load the page (it is some kind of UUID) so I can't use it as "anchor" for my xpath. However there is a heading for this table that seems reasonable to start with that has a fixed ID. Inbetween the heading and the table there are a couple of divs. So something like this (some mix of pseudo code and what I get when I copy selector and xpath in Chrome) to get to the first cell in the first line of the table:
//*[#id="heading"] (a bunch of divs) /*[#id="random string of letters"]/div[3]/div/div/div[2]
I would like to write an xpath that looked something like this
//*[#id="heading"] [wildcard for the random ID and divs] /div[3]/div/div/div[2]
How do I write this?
Thank you.
If only one element inside the "header" contains an id attribute you could use
//*[#id="heading"]//*[#id]/div[3]/div/div/div[2]
If there are more than one element with id attribute you need something more, eg if it contains a certain tag
//*[#id="heading"]//*[contains(#id, "tag")]/div[3]/div/div/div[2]
or (if using xpath 2.0) and only this #id contains an uuid within the heading
//*[#id="heading"]//*[matches(#id,"[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}")]/div[3]/div/div/div[2]
Otherways you will have to try to find something unique (within the context of "heading") to start the div[3]/div/div/div[2] search (if you are lucky div[3]/div/div/div[2] is unique enough.

Remove different links from MySQL table

How i could remove different links i have in a MySQL field in many rows? I couldn't find a query for that.
I don't have much experience with MySQL, the ideal solutions would be something that begins with something and ends with something.
Example:
On table 'ads' i have a field called 'description' that has the ad description text. I have links inside the descriptions and i want to remove them all, but those links have different urls from ads to ads. I don't want to delete the text of the link, just the link itself <a class="something" href="http://someurl.com">Link text</a>
Please give a better explanation of your problem and a sample of code.
Although, if i'm right on what you want to achieve, you might need something like this below.
Example:
UPDATE ads SET description=REPLACE(description,'whatYouWantToDelete','')
The above will remove everything in your column that contains the string foo.
UPDATE:
These might be helpful.
Remove HTML tags from record
Removing links from posts in wordpress using query

How can I hide/remove/disable "forums views" in vbulletin?

anyone have an idea how to do this.
i need to get rid of forum views either by hide, delete, disable or any other way.
I assume you mean THREAD views in the text below:
Do a template search for $thread[views], and there should be a template called threadbit. If you want to quickly and easily obscure the views just delete $thread[views] and replace with or asterisks, or whatever you'd like.
If you want to remove the whole <td> it becomes more complicated. First you remove that <td>, and then in FORUMDISPLAY template you have to remove the <td> that contains $vbphrase[views] (do a search for it if you can't find it).
But I believe there may be some issue with removing that entire column, and any of the hardcoded colspan attributes among the templates. If so then you would have to reduce the colspan number by one. I'm not sure about the colspan part, it's been a long time since I edited the FORUMDISPLAY and threadbit templates.
Also, you will need to remove the Views from another location in the threadbit template:
title="<phrase 1="$thread[replycount]" 2="$thread[views]"
This shows up when you hover on top of the Last Post column. Just delete $thread[views] and it will show up blank.
i need 50 points to reply, sorry for keep using answer.
i was thinking of going 1 step futher and swapping the word hidden for a picture?
I used the word hidden just as a test to see if it would work which it does