问题
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