Method to obscure URL from bots (similar to tripadvisor.com)

元气小坏坏 提交于 2019-12-13 04:00:00

问题


The URL to the Restaurant's website seems to be encoded in a way that it is not scrapable by a bot, yet when clicked on by a user, the URL loads in a new window:

http://www.tripadvisor.com/Restaurant_Review-g57415-d805527-Reviews-Harrison_s_Restaurant_Bar-Stowe_Vermont.html

The source for the span tag for the 'Website' link is below. How is tripadvisor obscuring/encoding the URL? Is there a way to replicate this or an existing library with similar functionality available?

<span class="taLnk hvrIE6" onclick="ta.trackEventOnPage('AttractionContactInfo', 'Website', 
805527, 1); ta.util.cookie.setPIDCookie(15190); ta.call('ta.util.link.targetBlank', event, this
 {'aHref':'LqMWJQiMnYeVtIJpEJCIQQoqnQQxGEcQQoqnQQeVtIJpEJCIQQoqnQQeVsSVuWJQzZYUWJQpEcYGII26Xomb
QQoqnQQQQoqnqgoqnQQQQoqnQQQQoqnQQQQoqnqgoqnQQQQoqnQQuuuQQoqnQQQQoqnxioqnQQQQoqnQQGJEEStiCttIiuV
QQoqnQQQQoqnxioqnQQQQoqnQQniaQQoqnQQQQoqnqgoqnQQQQoqnQQWJQzhYXHTHVdnM3XokX3nKJB', 
'isAsdf':true})" class="taLnk hvrIE6">Website</span>

回答1:


Try the easy way before of each href link put the follow change

normal way http://www.google.cl

new way http%3A%2F%2Fwww.google.cl

just put the http%3A%2F%2F before the page



来源:https://stackoverflow.com/questions/26560279/method-to-obscure-url-from-bots-similar-to-tripadvisor-com

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!