How to get a URL of a search result from a website?
May 16, 2022 10:09 AM   Subscribe

How do I generate a URL of a search result from a website which always shows its home URL? I would like to share a link with someone who could just click and see the result page.
posted by lanhan to Computers & Internet (10 answers total)
 
Depends on how the site is coded, but if you right click on the link and select "copy link address", that's probably the most common way.
posted by kevinbelt at 10:18 AM on May 16, 2022 [1 favorite]


i think otherwise, your have to dive into the browser's developer tools and look for the request that transports the actual original query.
posted by j_curiouser at 10:32 AM on May 16, 2022


Can you share (with us) the home URL?
posted by Press Butt.on to Check at 10:33 AM on May 16, 2022 [1 favorite]


Seconding the request for the website home URL, please.

Some websites like this have a share button somewhere, not always somewhere as obvious as they think it is. Some do not, in which case yeah, the browser developer tools are your best bet.

If you're accessing the site from a phone, you might have better luck if you try requesting the desktop site or accessing it from a computer instead.
posted by ManyLeggedCreature at 10:37 AM on May 16, 2022 [1 favorite]


What you want might be impossible depending on the site. There are multiple ways that the site could be implementing its search and only some of them can be linked to directly with a URL.
posted by AndrewStephens at 11:10 AM on May 16, 2022 [7 favorites]


Sometimes called Deep Linking if you are searching for help on this topic.
posted by soylent00FF00 at 1:02 PM on May 16, 2022


Response by poster: Here is one of the examples: https://doctors.cpso.on.ca/?search=general
I am helping out folks who are even less computer literate than me for health care information and I find these sites are surprisingly difficult to share. I have tried the browser developer tools but I couldn't find any link alike that works. Any idea that might help for sharing such search results?
posted by lanhan at 2:50 PM on May 16, 2022


Best answer: Unfortunately, I don't think this is going to be possible with the particular site you linked to. Without going into too much technical detail, the problem (as you correctly identified) is that the search parameters aren't contained in the URL. This is in contrast to how it works with, eg, a Google search, where you can just send someone a link to https://www.google.com/search?q=pictures+of+cats and everything works as you'd expect.

With the site you linked to, your browser is sending a more complicated request (called a "POST request") to the server, and (as part of the fundamental baked-in structure of the internet) you can't send a link to a POST request. (The Google example is what's called a "GET request".)
posted by number9dream at 5:20 PM on May 16, 2022 [2 favorites]


Best answer: Here is one of the examples: https://doctors.cpso.on.ca/?search=general

There are some rare special cases where you can extract enough information to create a URL from this sort of setup, but this case would require significant backward engineering.

For example, this is tantalizing...

https://doctors.cpso.on.ca//Doctor-Search-Results?type=name&term=Smith

...but figuring out the supported "type"s and the format of the "term" argument would be a mess.

All in all you would be better off finding sites that already have a Share button.
posted by Tell Me No Lies at 10:53 PM on May 16, 2022


Best answer: I was thinking you could set up a local webpage that duplicates that form or use something like Postman, but that search site submits via javascript postback and has CSRF protection in place so it would be a lot work to figure out and might not ever work.

I think your best bet is type in sample values in the appropriate fields, take a screen shot of those values and then use the picture as the basis for writing some documentation for the users you are trying to help.
posted by Press Butt.on to Check at 7:11 AM on May 17, 2022


« Older Worried about cats in apartment after eviction   |   What is this grass watering tool, and how can I... Newer »
This thread is closed to new comments.