Help with Calendar

Hello,
I can't seem to be able to get past inputting the date in order to scrape the data after hitting search.
Thanks!

{"_id":"ktest","startUrl":["https://bookings.alaskacollection.com/TAC/hotels/details/DNP-DBL/Hotel#/select-booking-type/book-stay"],"selectors":[{"id":"name","type":"SelectorText","selector":"div.ticket-title","parentSelectors":["search"],"multiple":true,"regex":"","delay":0},{"id":"bed","type":"SelectorText","selector":"li.bed","parentSelectors":["search"],"multiple":true,"regex":"","delay":0},{"id":"price","type":"SelectorText","selector":"div.price-group","parentSelectors":["search"],"multiple":true,"regex":"","delay":0},{"id":"search","type":"SelectorElementClick","selector":"div.panel-row div.panel-body","parentSelectors":["cal"],"multiple":true,"delay":"500","clickElementSelector":"div.form-group-row button.btn","clickType":"clickMore","discardInitialElements":false,"clickElementUniquenessType":"uniqueText"},{"id":"cal","type":"SelectorElementClick","selector":"div.panel-row div.panel-body","parentSelectors":["_root"],"multiple":true,"delay":"500","clickElementSelector":"div.calendar.left tr:nth-of-type(n+2) td","clickType":"clickOnce","discardInitialElements":false,"clickElementUniquenessType":"uniqueText"}]}

Hi!

It's much easier to use WebScraper + JavaScript injector extension in this case, as neither URL or page contents change if 'Search` button is not pressed after setting a date (automatically display results on date change, for example)

I've managed to get it to change the date, but it requires to also click Search each time you change the date.

There is a workaround that will require you to press Search button manually after date changes on-the-fly though.

Would you mind sharing how you got it to the point where you can change the date and just manually hit search? Just wondering what I'm doing wrong on my end

I'm currently at job, i've made you a quick example.
It will continue switching days, I still have to limit the selector for you for just a current month though.

{"_id":"alaskacollection","startUrl":["https://bookings.alaskacollection.com/TAC/hotels/details/DNP-DBL/Hotel#/select-booking-type/book-stay"],"selectors":[{"id":"date_change_day","type":"SelectorElementClick","selector":"div.col-sm-7 div.list-scroll-wrapper","parentSelectors":["_root"],"multiple":true,"delay":"2000","clickElementSelector":"div.form-group-row input, td.available:not(.today)","clickType":"clickOnce","discardInitialElements":false,"clickElementUniquenessType":"uniqueHTMLText"}]}

Awesome thanks so much, Do you just instantly search when the date changes and it'll scrape it all?

I'd increase the click delay to a time you need to click 'Search' to something about 5-6 seconds.

You still need to build a selectors for it. Most important one is to read actual selected day. The correct selector for currently selected day is td.active

All available days: td.available
Today: td.today

Overall scheme will be pretty much sophisticated, I've spent a good hour on it yesterday and did not succeed, unfortunately.

Yeah same with me I've run like 2million data point scrapes before just fine but this one is tricky lol

If this website wasn't designed not to keep all data only within current session it would've been much easier to work with it :frowning:

1 Like

Do you happen to know why with searching manually It's not extracting data? Wondering if my selectors are wrong to cause that

{"_id":"kartiktest2","startUrl":["https://bookings.alaskacollection.com/TAC/hotels/details/DNP-DBL/Hotel#/select-booking-type/book-stay"],"selectors":[{"id":"date_change_day","type":"SelectorElementClick","selector":"div.col-sm-7 div.list-scroll-wrapper","parentSelectors":["_root"],"multiple":true,"delay":"3500","clickElementSelector":"div.form-group-row input, td.available:not(.today)","clickType":"clickOnce","discardInitialElements":false,"clickElementUniquenessType":"uniqueHTMLText"},{"id":"Name","type":"SelectorText","selector":"div.ticket-title","parentSelectors":["date_change_day"],"multiple":true,"regex":"","delay":0},{"id":"date","type":"SelectorText","selector":"td.today","parentSelectors":["date_change_day"],"multiple":false,"regex":"","delay":0},{"id":"beds","type":"SelectorText","selector":"li.bed","parentSelectors":["date_change_day"],"multiple":true,"regex":"","delay":0},{"id":"price","type":"SelectorText","selector":"div.price-group","parentSelectors":["date_change_day"],"multiple":true,"regex":"","delay":0}]}

Follow up: Do you think running my page load delay under the scrape options would fix it?

It needs testing. I'll try to look into it today after i get home :slight_smile:

Appreciate it thanks!

No luck so far, i believe it's not possible to do such scrape automated way using current iteration of WebScraper. Maybe @KristapsWS will look into it once he have free time.
Sorry If I wasted your time.

Currently it is not possible to scrape this site with Web Scraper because it requires element click selector as child selector for another element click selector.