/    Sign up×
Community /Pin to ProfileBookmark

Question on pop up pages

I use a website the produces pop up pages with prices from various supermarkets, mysupermarket.com how do i get the link for the popup of a product where it shows the various supermarket prices . I want to place the link in a spreadsheet so it will being up the list then i can indicate in the spreadsheet which supermarket is the one to buy from.

Thanks in advance for any help

Colin

to post a comment
HTML

1 Comments(s)

Copy linkTweet thisAlerts:
@nap0leonNov 06.2014 — You can get all the URLs for each popup's HTML by running this code on each page:
<i>
</i>$('.MspProductListCell.InStock').each(function(){
console.log('http://www.mysupermarket.com/Ajax/FetchUserControl.aspx?UserControl=Popup_NgProductDetails&amp;ProductID=' + $(this).attr('productid') + '&amp;TrackingCode=' + $(this).attr('trackingcode'));
});


To get the name of the store from each of these, you run something like this:
<i>
</i>$('.NgMspProductPrice #PriceStore img').attr('alt')


Since jQuery is not in scope in the popups, you'll need to convert that to straight JavaScript.

You should be able to create a webpage that performs an AJAX request for each URL you've mined and appends the HTML to the DOM. Then read that new HTML for the name of the product, store, price, etc. Write out that information to our page, then remove that code from your DOM and continue on to the next URL.
×

Success!

Help @Colin58 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...