Method to obscure URL from bots (similar to tripad

2019-09-06 09:25发布

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条回答
对你真心纯属浪费
2楼-- · 2019-09-06 09:37

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

查看更多
登录 后发表回答