allcapone1912 7 Posted August 16, 2015 Report Share Posted August 16, 2015 hi,can not get website url from tripadvisor.co.uk For ex:http://www.tripadvisor.co.uk/Restaurant_Review-g1016887-d1847312-Reviews-Wild_Boar_Restaurant_at_Sitwell_Arms_Hotel-Renishaw_Derbyshire_England.html As results should be "http://www.sitwellarms.com/restaurant.html#_=_" I dont see url in site code Quote Link to post Share on other sites
pftg4 102 Posted August 16, 2015 Report Share Posted August 16, 2015 there is a parameter $url does that not work??? Quote Link to post Share on other sites
allcapone1912 7 Posted August 16, 2015 Author Report Share Posted August 16, 2015 i dont want to get current url,i need to get company websitehttp://s28.postimg.org/4x7zzt2gt/Untitled.png Quote Link to post Share on other sites
pash 504 Posted August 16, 2015 Report Share Posted August 16, 2015 Try. allow popups("In New Window") navigate("http://www.tripadvisor.co.uk/Restaurant_Review-g1016887-d1847312-Reviews-Wild_Boar_Restaurant_at_Sitwell_Arms_Hotel-Renishaw_Derbyshire_England.html","Wait") wait for browser event("Everything Loaded","") wait(1) click(<onclick=w"*\', \'isAsdf\':true\})">,"Left Click","No") wait(4) in popup { alert($url) close page } 1 Quote Link to post Share on other sites
deliter 203 Posted August 16, 2015 Report Share Posted August 16, 2015 I found finding by that button too difficult,but for the email link,it shows the email address in the document text,so you can just modify the email address,excuse my regex,I am awful at regex,maybe if this method doesn't return a result than use Pash's method above for a definite result set(#yrd,$document text,"Global")set(#find regular,$find regular expression(#yrd,"\\.checkEmailAction\',event,this,\'.+?@.+?\'"),"Global")set(#result,$replace regular expression($find regular expression(#find regular,"\'.+?@.+?\'$"),"\',event,this,",""),"Global")set(#result,"http://www.{$replace regular expression($find regular expression(#result,"@.+"),"@|\'","")}","Global") Quote Link to post Share on other sites
Pete 121 Posted August 16, 2015 Report Share Posted August 16, 2015 Or go mobile clear cookiesset user agent("Android")navigate("http://www.tripadvisor.co.uk/Restaurant_Review-g1016887-d1847312-Reviews-Wild_Boar_Restaurant_at_Sitwell_Arms_Hotel-Renishaw_Derbyshire_England.html","Wait")wait for element(<class="close_button">,300,"Appear")click(<class="close_button">,"Left Click","No")click(<class=" noDivider ">,"Left Click","No")alert($url) 1 Quote Link to post Share on other sites
allcapone1912 7 Posted August 16, 2015 Author Report Share Posted August 16, 2015 Thanks everyone for help Quote Link to post Share on other sites
allcapone1912 7 Posted August 16, 2015 Author Report Share Posted August 16, 2015 Try. allow popups("In New Window") navigate("http://www.tripadvisor.co.uk/Restaurant_Review-g1016887-d1847312-Reviews-Wild_Boar_Restaurant_at_Sitwell_Arms_Hotel-Renishaw_Derbyshire_England.html","Wait") wait for browser event("Everything Loaded","") wait(1) click(<onclick=w"*\', \'isAsdf\':true\})">,"Left Click","No") wait(4) in popup { alert($url) close page }great,finally its workinteresting method Quote Link to post Share on other sites
allcapone1912 7 Posted August 16, 2015 Author Report Share Posted August 16, 2015 I found finding by that button too difficult,but for the email link,it shows the email address in the document text,so you can just modify the email address,excuse my regex,I am awful at regex,maybe if this method doesn't return a result than use Pash's method above for a definite result set(#yrd,$document text,"Global")set(#find regular,$find regular expression(#yrd,"\\.checkEmailAction\',event,this,\'.+?@.+?\'"),"Global")set(#result,$replace regular expression($find regular expression(#find regular,"\'.+?@.+?\'$"),"\',event,this,",""),"Global")set(#result,"http://www.{$replace regular expression($find regular expression(#result,"@.+"),"@|\'","")}","Global")i've used this method in past and not always get the right url,sometime email have free domain(yahoo.gmail or other domain that not match url) Quote Link to post Share on other sites
allcapone1912 7 Posted August 16, 2015 Author Report Share Posted August 16, 2015 Or go mobile clear cookiesset user agent("Android")navigate("http://www.tripadvisor.co.uk/Restaurant_Review-g1016887-d1847312-Reviews-Wild_Boar_Restaurant_at_Sitwell_Arms_Hotel-Renishaw_Derbyshire_England.html","Wait")wait for element(<class="close_button">,300,"Appear")click(<class="close_button">,"Left Click","No")click(<class=" noDivider ">,"Left Click","No")alert($url)thanks for your codegood idea to go mobile Quote Link to post Share on other sites
deliter 203 Posted August 17, 2015 Report Share Posted August 17, 2015 Hey A very helpful man I got to know on the internet,had a look at this topic and posted me the solution,which is pure JS,so you might be like me and not really know what it is happening here,but its nice to have an idea,the href variable is my code,thats why it looks a bit worse than the rest ha sorry I posted it but it wouldn'twork,maybe parsing it to the page make a set set(#url,$eval(""),"Global") and go to node view,and paste this code below into the eval var href = document.querySelectorAll("span.taLnk.hvrIE6") var href = href[0].onclick.toString().match(/{'aHref':'.+?'/).toString().split("{'aHref':'").join("").split("'").join("") var url = decodeURIComponent( asdf(href) ); console.log( url ); url = url.replace(/__5F____5F__(..)__5F____5F__/g,"%\$1"); console.log( url ); url = decodeURIComponent( url ); console.log( url ); url = url.replace(/.*a_url\.(.*?)-a_url.*/,"\$1"); console.log( url ); function getOffset(a) { if (a >= 97 && a <= 122) { return a - 61 } if (a >= 65 && a <= 90) { return a - 55 } if (a >= 48 && a <= 71) { return a - 48 } return -1 } function asdf(d) { var h = {"": ["&", "=", "p", "6", "?", "H", "%", "B", ".com", "k", "9", ".html", "n", "M", "r", "www.", "h", "b", "t", "a", "0", "/", "d", "O", "j", "http://", "_", "L", "i", "f", "1", "e", "-", "2", ".", "N", "m", "A", "l", "4", "R", "C", "y", "S", "o", "+", "7", "I", "3", "c", "5", "u", 0, "T", "v", "s", "w", "8", "P", 0, "g", 0],q: [0, "__3F__", 0, "Photos", 0, "https://", ".edu", "*", "Y", ">", 0, 0, 0, 0, 0, 0, "`", "__2D__", "X", "<", "slot", 0, "ShowUrl", "Owners", 0, "[", "q", 0, "MemberProfile", 0, "ShowUserReviews", '"', "Hotel", 0, 0, "Expedia", "Vacation", "Discount", 0, "UserReview", "Thumbnail", 0, "__2F__", "Inspiration", "V", "Map", ":", "@", 0, "F", "help", 0, 0, "Rental", 0, "Picture", 0, 0, 0, "hotels", 0, "ftp://"],x: [0, 0, "J", 0, 0, "Z", 0, 0, 0, ";", 0, "Text", 0, "(", "x", "GenericAds", "U", 0, "careers", 0, 0, 0, "D", 0, "members", "Search", 0, 0, 0, "Post", 0, 0, 0, "Q", 0, "$", 0, "K", 0, "W", 0, "Reviews", 0, ",", "__2E__", 0, 0, 0, 0, 0, 0, 0, "{", "}", 0, "Cheap", ")", 0, 0, 0, "#", ".org"],z: [0, "Hotels", 0, 0, "Icon", 0, 0, 0, 0, ".net", 0, 0, "z", 0, 0, "pages", 0, "geo", 0, 0, 0, "cnt", "~", 0, 0, "]", "|", 0, "tripadvisor", "Images", "BookingBuddy", 0, "Commerce", 0, 0, "partnerKey", 0, "area", 0, "Deals", "from", "\\", 0, "urlKey", 0, "'", 0, "WeatherUnderground", 0, "MemberSign", "Maps", 0, "matchID", "Packages", "E", "Amenities", "Travel", ".htm", 0, "!", "^", "G"]}; var b = ""; for (var a = 0; a < d.length; a++) { var j = d.charAt(a); var f = j; if (h[j] && a + 1 < d.length) { a++; f += d.charAt(a) } else { j = "" } var g = getOffset(d.charCodeAt(a)); if (g < 0 || typeof h[j][g] == "String") { b += f } else { b += h[j][g] } } return b } url Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.