55

In Firefox, after searching for some keyword in Google and getting a list of results, I would like to copy the link address of a particular result. But I find that the link address is not the actual address, but some modification by Google to include some information about Google itself.

For example, search "regex Is it worth using Python re.compile" in Google, and the first result is "regex - Is it worth using Python's re.compile? - Stack Overflow" whose address is https://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile.

Right-clicking the result, and selecting "copy the location", I will get

http://www.google.com/url?sa=t&source=web&cd=1&ved=0CBoQFjAA&url=http%3A%2F%2Fstackoverflow.com%2Fquestions%2F452104%2Fis-it-worth-using-pythons-re-compile&ei=j-WXTdKjE8KZ0QH7hNGGDA&usg=AFQjCNGl8DlEwS7SQ8vWxBPyiZBUbUj0Yg&sig2=Mnnj7wRN1Z6on5hjIuq7FQ

But I wish to get just https://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile.

I remember Google search used to work in the same way as I wish, but now it has changed. I was wondering if I am missing something and how to do as I wish?

2

16 Answers 16

22

There's a Greasemonkey script that can change the Google Search result links back to direct links, then you can simply copy and paste them like normal links on the web.

1
  • 2
    Aww, man. I was off searching for another solution, came back after having found the Greasemonkey script, edited my post... and then saw this update! :( Upvote for beating me to it.
    – Ryan
    Apr 3, 2011 at 3:18
21

Simplest method without scripts or any other troublesome stuff. Tried and tested in Firefox and Internet Explorer.

  1. Reload/refresh the page (F5) (because Step 2 will work only if you haven't already clicked the link).
  2. "Right-click and hold" on some empty space away from the link. Move your mouse pointer (with right button still depressed) over the link. Release right-click and select 'Copy link location/shortcut'.

(Credit to stormenet.)

8
  • 2
    Does not work reliably (or I'm misunderstanding the "empty space away from the link" stanza). See webapps.stackexchange.com/questions/40837/… which on the surface sounds like a duplicate but actually is not because it specifically does not call for GreaseMonkey or PHP scripts.
    – bgoodr
    Feb 23, 2013 at 17:44
  • 1
    It works for me. Empty space is e.g. the white space to the left of the links. Did you reload the page? Once clicked or right-clicked, the link changes to the google-generated one, so you need to reload the search result page to have the original link again.
    – benczur
    Feb 24, 2013 at 0:57
  • 1
    this worked for me.. great answer!!!!!!!!!
    – ihightower
    Aug 6, 2013 at 3:16
  • 1
    When the Google result page is first loaded, the mouseover URL is the raw link. This solution works. If I left-click on the URL, then the mouseover URL is changed to the redirect link. This solution fails. Reloading the page restores the link to the raw link.
    – Nathan
    Jan 6, 2014 at 18:59
  • 7
    Not working here ... the moment the right mouse button is depressed, a menu pops up, wasting the command. Dragging over to the link then does nothing because the menu has already popped up! This is on Firefox version 29.0.1 Linux 64-bit. Though this post is from 2013 -- perhaps something has changed in newer versions of Firefox, or the Linux versions are different, in which case that should definitely be mentioned. Jun 13, 2014 at 7:10
17

Use this service: http://urlclean.com/

You insert the copied link from Google results and get clean URL without Google redirection code.

Web preview

4
  • 2
    This is by far the best answer. The OP's accepted answer only works for some versions of Firefox on some platforms; this works for any browser, any time. Sep 8, 2016 at 11:20
  • Can anyone explain how this works? Does it simply take the URL and sanitize it by removing e. g. whitespaces and specially encoded characters? If so then this is probably easy to re-implement in ruby, python etc... - I don't see the source code right now ... :(
    – shevy
    Apr 11, 2020 at 20:17
  • @shevy yes, it just looks for the "url=" part in the URL and unescapes it. It should be easy to recreate in any language, particularly if it has a function for unescaping URLs. Mar 20, 2021 at 12:57
  • 1
    Best answer for mobile browser
    – chutz
    Feb 19, 2023 at 9:39
6

The actual link location is located directly below the link description. You could copy and paste it from there.

enter image description here

I assume the added stuff is so that Google can log when others are accessing that site link.

If the problem is the link length, you could try using a URL shortening service.

There's a Greasemonkey Script that will disable what you're talking about.

3
  • 8
    Thanks! The Python example is too simple. When the actual address is too long, Google will not display the full length of the address. For example, after searching "python regex", the first result.
    – Tim
    Apr 3, 2011 at 3:09
  • 8
    You could find abbreviations like www.confickerworkinggroup.org/...test/cfeyechart.html
    – belisarius
    Apr 3, 2011 at 3:09
  • 2
    this is possible only when the link is short enough to be displayed in the space Google gives it on that line .... it truncates a lot of urls so you can't copy them.
    – markling
    May 24, 2019 at 12:54
5

In Chrome Win7X64, right clicking whitespace away from a link, and releasing that click over the link, worked perfectly for me on a lengthy .ppt, just as suggested by benczur.

The google link:

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&ved=0CDIQFjAA&url=http%3A%2F%2Fwww.fda.gov%2Fohrms%2Fdockets%2Fac%2F05%2Fslides%2F2005-4144s1_05_Mendelson-HF-NHD%2520Pane.ppt&ei=NOFBUYKHBM-64APKnYGQAw&usg=AFQjCNGka328-0Jym7wOYtJ8pdgGJjLv6Q&sig2=Iq2vS_O3AfCioprk-j_q2w

The whitespace/release version:

http://www.fda.gov/ohrms/dockets/ac/05/slides/2005-4144s1_05_Mendelson-HF-NHD%20Pane.ppt

2
  • 2
    Works in Firefox as well. Obviously, it works because Google JS captures mouse down whereas menu with "copy link" appears on mouse up
    – Val
    Apr 3, 2013 at 10:41
  • How exactly does it work in firefox? I mean the actual steps please - right now I can not get that to work, it still shows only the long URL ...
    – shevy
    Apr 11, 2020 at 20:20
4

If you click on the result, and open such a page, you will see that the address bar in the top of your browser (where it says http://*), the address will also change to http://www.python.org/. You can copy the address from there.
What Ryan said is also true, but the problem is that google also shortens links (ex: "nl.wikipedia.org/.../Python_(programmeertaal)").

3
  • 10
    This does not work if the search result is, e.g., a PDF document (or in general something that is not displayed by your browser). Apr 25, 2011 at 0:48
  • Thanks Jukka. I've confirmed that in detail at webapps.stackexchange.com/questions/40837/… which I hope someone will answer someday.
    – bgoodr
    Feb 23, 2013 at 17:48
  • Exactly! I need to download some .pdf files which I automatically retrieve, and the Google URL is pretty useless - so my use case is exactly that as well. I need to find the genuine source. It's quite annoying that we can not just easily copy/paste this from the browser...
    – shevy
    Apr 11, 2020 at 20:19
3

I also thought what you said happens, but looks like it doesn't: enter image description here

Any possibility this is browser dependent? Which browser are you using? (Screenshot from Firefox 4, same behavior in Chrome, both on OSX 10.6)

I thought this may be dependent whether you are signed in to Google or not. But it is not. The behavior is the same.

5
  • I think it's dependent on whether you happen to be on their sample group at that time or not; I've had it happen to me some days and not others, using the same browser, account, etc. Apr 3, 2011 at 12:34
  • 3
    It shows it like that in the statusbar, but that's some javascript magic you're seeing, on the onmousedown on the link the link is changed. Try copying the link, you'll see that doesn't copies that link ;)
    – Stormenet
    Apr 3, 2011 at 13:42
  • @Stormenet I remember it happening before, but at least right now it points to the target page (the href is the target page). Could be a focus group, as @André Paramés pointed out...
    – Nivas
    Apr 3, 2011 at 14:12
  • 4
    this is the html from that particular link: <a class="l" onmousedown="return rwt(this,'','','','4','AFQjCNGl8DlEwS7SQ8vWxBPyiZBUbUj0Yg','Nlw9cdFH31TadhaL8C4A8g','0CDEQFjAD')" href="http://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile" done="done" realurl="http://stackoverflow.com/questions/452104/is-it-worth-using-pythons-re-compile"><em>regex - Is it worth using Python's re.compile</em>? - Stack Overflow</a>Which is clearly changing the link on mousedown,try mousdedown on it,and drag away so you don't click it, the link will be different next time you hover
    – Stormenet
    Apr 3, 2011 at 19:36
  • Interesting work-around trick by Stormenet there.
    – shevy
    Apr 11, 2020 at 20:24
3

You can simply right click on your mouse and click on "inspect element" (on Google Chrome) and your full link will appear somewhere (you can hit Ctrl + F and enter some keywords of your link to find it quickly).

Another way of doing it, is the following: before you do a right click on the link, open developer tools (F12) and select the link with dots:

(http://something.something/aaa....aaa.html)

In html code you will see the proper link that you can copy/paste where you need it.

2

You can also use the scroogle site (http://www.scroogle.org/cgi-bin/scraper.htm) which is primarlily aimed at "google privacy concerns", bit a side effect is it produces direct links.

Scroogle is occasionally "broken"/doesn't work, mostly after google adds some innovation that changes the way it works.

It also won't give you the same answers as google, if your results have geographic weighting, or other non-generic search order issues.

2

It was quite easy to write PHP script for decoding "google's links" to normal URLs. Here is it: http://george.vps.websupport.sk/google/

3
  • Thanks! What is the script? How does it solve the problem?
    – Tim
    Jun 28, 2012 at 0:19
  • 1
    This script simply relies on current format of google's links and parses it ($link are data from POST): $startPosition = strpos($link, '&url=') + 5; $endPosition = strpos($link, '&ei='); $length = $endPosition - $startPosition; $url = urldecode(substr($link, $startPosition, $length)); echo "<a href=\"$url\">$url</a>"; It doesn't solve the problem of showing google's links during google search but the links can be easily converted to original URLs. PS: How can I add line breaks? Two spaces don't work.
    – George
    Jun 28, 2012 at 8:52
  • Thanks. I don't know how to add line breaks either.
    – Tim
    Jun 28, 2012 at 10:11
2

For Firefox, the Copy Real Url plugin solves the problem for me.

2

Found this while searching for a simple little plugin I had installed in Safari (as far as I call recall) on my previous Mac. In case someone is still looking, it is now a browser extension on

Yet I am still looking for a Safari version!

1

The one from userscript mentioned before doesn't work no. If you are using chrome, you can try this extension: https://chrome.google.com/webstore/detail/remove-google-redirects/ccenmflbeofaceccfhhggbagkblihpoh

It works for me.

1

Benczur's answer has been the simplest one for me to use, without extra tools needed, but as pointed out, in recent versions of Firefox (in my case it's 35.0.1) a context menu pops up right after clicking the mouse left button, not after releasing it, so the trick doesn't work anymore.

However, you might consider another simple "hack" to overcome this. Just activate the inspector tool (Shift+Ctrl+C shortcut), then right-click on a given link within Google Search results and select Copy Link Location. Because you've got the inspector tool activated, it would prevent Google's script from replacing original link's location with their own.

Hope that helps.

1
  • You're not understanding Benczur's method at all. It clearly says to right click on an empty space then hover the link while still holding right click. And it's no empirical magic, it's the very way the code works. Inspect the code source of the page and you will see that this is an onmousedown action that gets triggered. So it has always triggered, as the name says, on mouse down, not after release (which would be onmouseup). It has always worked and still works now. You simply did not test the behavior well.
    – adamency
    Jan 10, 2023 at 23:54
0

The only way you can possibly solve this issue now is this way:

  1. Find the link that you would like to copy.
  2. At the end of the green incomplete link that you want, click on the down arrow.
  3. Choose "Cached'
  4. The top of the page should say "This is Google's cache of..." followed by the url you want to copy.
  5. Just right click that url to copy it and you should have the link.

It's an extra step, but hey, at least it works.

-1

Use Bing. Worked for me in Chrome

Not the answer you're looking for? Browse other questions tagged or ask your own question.