Jump to content

Automated way to track price drops and get email alerts?


mikeerdas

Recommended Posts

Is there any way I can track price drops on my sailing and cabin class in an automated way? Really hoping for a few price drops between now and final payment, but I hate checking manually every day.

 

Guess I could try to write some "screen scraping" code to do this, but would rather not re-invent the wheel.

 

Mike

Link to comment
Share on other sites

Hi,

 

I don't know if this will help, and I haven't tried it (nothing booked!).

 

http://www.changedetection.com/

 

I think someone posed this link someplace on CC and I bookmarked it, but haven't tried it.

 

I have tried this link and it does work, you get emails everytime the page changes, beware thougth that the page updates it's date every day, so you get an email confirming this. From the email there is a link that shows you the changes, a lot easier than doing a fake booking to find out

Link to comment
Share on other sites

Hi,

 

I don't know if this will help, and I haven't tried it (nothing booked!).

 

http://www.changedetection.com/

 

I think someone posed this link someplace on CC and I bookmarked it, but haven't tried it.

 

 

I am the one that posted the link.it does tell you whenever there is any kind of change..if anything, it serves as reminder for me to check the price...I haven't seen the price change on any of the pages..so I can't guarantee it works.

Link to comment
Share on other sites

I am the one that posted the link.it does tell you whenever there is any kind of change..if anything, it serves as reminder for me to check the price...I haven't seen the price change on any of the pages..so I can't guarantee it works.

 

Thanks for posting that link! I have used it to monitor pricing on my upcoming VOS cruise and it actually does work. In my case though, the prices have only went up during the past several weeks.

 

FYI - - To use this web page start a fake reservation request on the cruise that you want to monitor. Stop when you get to the page that shows the pricing for the catagory of cabin that you are going to book. Use "Change Detection" to monitor that final URL. It will send you an email whenever there is any change to that specific web page.

Link to comment
Share on other sites

I have seen the posts about price drops. If you see a drop on your cruise say on **********...and RCCL is showing a higher price...do you just call RCCL and ask for the lower price? I ususally book through RCCL directly...just want to make sure I know what I am talking about before I call them...

Thanks for any help.

Link to comment
Share on other sites

Just to add to this, for airline notifications, a great site is yapta dot com.

They monitor every change to your flight pricing, send out bi-weekly notifications and emergency alerts when your price has dropped enough for a refund. It's worked twice for me in the past. I love it!

Link to comment
Share on other sites

Here's a Python script that seems to work. I didn't like the change detection web site someone posted--not if a date changes on a web page every day... this script allows you to limit your search to a particular search term, e.g. price.

 

Recommended for people who know Python or those with programming experience for tweaking. One thing about Python is that indentation matters--do not muck with indentation. To test it, you can start with a search term you know exists, e.g. existing price, change the text file to a different price, then re-run the script and see what happens.

 

This script uses a text file (that you create) to search for however many cruises you want, and creates a log file of the results.

 

One deficiency of the script is that you'll need to change the search term in the input file once a change has been detected. Otherwise, you'll be told there's been a change every time you run it.

 

Read all the comments before running (#) and this is for educational purposes only of course. I wouldn't completely trust the results, but it's a good first stab.

 

If you find the script useful, please post here. And please post any improvements you make. I need to add an email notification function to make it more useful.

 

# Detect change on a web page

# Tested on Python 2.4.

 

# Instructions: Use at your own risk. Before running:

# 1) Change the directories for "input" and "log" below. Use forward slashes ("/"), not backwards slashes

# even if you are using Windows

#

# 2) Create a file named url-vals.txt with one line per search and three values per line: name, search term (e.g. price), and url

# Use a pipe "|" symbol to separate the values

# Lines will look something like:

# Name of my cruise here |$1,594|url goes here

# Do not put any extra spaces in your search term.

 

# To-do list:

# [ ] Use smtplib module to add an email alert function.

# [ ] Somehow capture the price change and alter the input text file to reflect the new price to search for.

 

import urllib, time, sys

 

# File of URLs, expected values, and a name; each separated by a pipe "|" symbol.

input = open('G:/1-work/PYTHON/url-vals.txt', 'r')

 

# Log file of results as comma separated values. May be opened with / imported into Excel

log = open('G:/1-work/PYTHON/change-log.txt', 'a')

 

def getpage(name, change, url):

current = time.time()

the_time = time.ctime(current)

change = change.upper()

try:

p = urllib.urlopen(url)

except:

print "Could not open URL", url

print "Giving up."

log.write("'" + str(the_time) + "'," + "'" + str(name) + "'," +

"'FAILED! Could not open URL'," + str(change) + "\n")

return

l = p.readlines()

found = ''

 

for i in l:

i = i.upper()

if i.find(change) > 0:

found = 'YES'

if found <> 'YES':

print "Your value can no longer be found.", name

print "Better check the web page and update."

print name

else:

print "Sorry, no change today for", name

log.write("'" + str(the_time) + "'," + "'" + str(name) + "'," +

"'no change'," + str(change) + "\n")

 

# getpage(url, change)

 

lines = input.readlines()

 

for i in lines:

name, change, url = i.split('|')

getpage(name, change, url)

 

current = time.time()

print time.ctime(current)

 

input.close()

log.close()

print "Finished!"

sys.exit()

 

# End of script

Link to comment
Share on other sites

I have seen the posts about price drops. If you see a drop on your cruise say on **********...and RCCL is showing a higher price...do you just call RCCL and ask for the lower price? I ususally book through RCCL directly...just want to make sure I know what I am talking about before I call them...

Thanks for any help.

 

Cruiselines do not match a TA's price...TA's are rebating part of their commission, or have a group set up to lower prices.

Link to comment
Share on other sites

If your price drops after final payment, are you due the difference? Should I call my TA?

 

From what I understand, if you go through a TA, it's up to them whether they want to honor the decrease in price. If they do, most likely you'll either get OBC or an upgrade if it's after final payment.

Link to comment
Share on other sites

Isn't that half the fun, obsessive-compulsively check the prices on the website? If you really are compulsive you aren't going to trust the programs anyway.:D I never check after final payment. No need to get yourself disgusted.;)

 

 

Why not? Maybe you're not aware but RCCL gives price drops even after final payment! :D

Link to comment
Share on other sites

mikeerdas, can you show an example of the url you use?

This looks interesting and I think I will try to use it. I may have more questions as I go along.

Thanks

 

 

Here's an example URL to try:

 

http://www.royalcaribbean.com/booking/getDepartureInfo.do?packageCode=LG12M085&shipCode=LG&sailDate=1090917&adultCount=2&childCount=0&hasTour=N&hasTransfer=N&neither=Y&state=

 

You'll need to create a url-vals.txt file with one line in it that looks like:

 

Legend 12 day Europe Sept 17,2009|$1,649|http://www.royalcaribbean.com/booking/getDepartureInfo.do?packageCode=LG12M085&shipCode=LG&sailDate=1090917&adultCount=2&childCount=0&hasTour=N&hasTransfer=N&neither=Y&state=

 

Note that this particular URL only gets you to a page that shows "Prices starting from...". I have not experimented with pages deeper down showing actual prices for cabin classes. Prices could be changing with higher-priced cabins while the cheapest price stays the same. But since I book low-priced cabins, I've found it works for me.

 

The URL is the page immediately before you have to hit the "Save Changes to Continue" button. Beyond that, I'm not sure the script would work. Although there may be sites other than RCCL.COM you could try for tracking specific cabin prices. From what I understand, all RCI cruise prices are the same everywhere, with the only difference being extra perks like OBC, etc.

 

Good luck and let us know how things work if you do more experimentation.

Link to comment
Share on other sites

mikeerdas,

I installed python3.0, copied your code from # Detect change on a web page to # End of script, changed the directories to c:/Python30/Lib/ and named the file fares.py and saved it in the Python30 directory. I created a txt file with my cruise info and saved it in the Lib directory as url-vals.txt

When I double click on fares.py, a window pops up but no log file is created. I changed the url-val.txt to your sample (Legend 12 day Europe Sept 17,2009|$1,649|http://www.royalcaribbean.com/bookin...ither=Y&state=) and still no log file. I guess I also expected a widnow to open for http://www.royalcaribbean.com/bookin...ither=Y&state=

Is there a way to display what is going on so I can see where my problem is?

Thanks for your patience.

Link to comment
Share on other sites

mikeerdas,

I installed python3.0, copied your code from # Detect change on a web page to # End of script, changed the directories to c:/Python30/Lib/ and named the file fares.py and saved it in the Python30 directory. I created a txt file with my cruise info and saved it in the Lib directory as url-vals.txt

When I double click on fares.py, a window pops up but no log file is created. I changed the url-val.txt to your sample (Legend 12 day Europe Sept 17,2009|$1,649|http://www.royalcaribbean.com/bookin...ither=Y&state=) and still no log file. I guess I also expected a widnow to open for http://www.royalcaribbean.com/bookin...ither=Y&state=

Is there a way to display what is going on so I can see where my problem is?

Thanks for your patience.

 

First, definitely don't double-click on your fares.py. Because it will open/close so fast you can't see what's going on.

 

You should either run it from the command line (Start > Run > type "cmd" here and hit enter) or from a free GUI like PythonWin (if you're on Windows). This is so you can see whatever errors might be occurring. I don't use Python 3.0, so I don't know what the install is like; you'd run it by typing "python fares.py". If that fails, simply try typing "python". If that fails, then Python is not in your path and you will either need to set an environment variable for it, or find out where the python executable is and call python with it's full directory path. In the Python script, are you sure you gave the full path to the txt file and where the log file should go?

 

You won't see a browser window open, ever. The call to the web page occurs behind the scenes.

 

Feel free to post whatever errors you get.

 

Hope this helps.

Link to comment
Share on other sites

If I try to run from the start> run> cmd line, the "python window" flashes like it did when I double clicked the fares.py file.

 

I opened the start> all programs> python 3.0> python (command line) then I get the "python window" with a >>> cursor

 

If I just type

>>>fares.py at the python command line I get this message:

traceback (most recent call last):

File "<stdin>", line 1 in <module>

Name Error: name 'fares' is not defined

When I enter >>>python fares.py I get this message:

File "<stdin>", line 1

python fares.py

Syntax error: invalid syntax

under the s of fares is a ^

 

No log file out put is created in either case.

 

these are the lines I changed in your script:

# File of URLs, expected values, and a name; each separated by a pipe "|" symbol.

input = open('c:/Python30/Lib/url-vals.txt', 'r')

 

# Log file of results as comma separated values. May be opened with / imported into Excel

log = open('c:/Python30/Lib/change-log.txt', 'a')

 

So I would expect to find the log file in c:/Python30/Lib but, I also searched my computer for change-log.txt and didn't find anything.

 

My url-vals.txt test file looks like this:

Legend 12 day Europe Sept 17,2009|$1,649|http://www.royalcaribbean.com/bookin...ither=Y&state=

Link to comment
Share on other sites

Cris,

 

> If I just type >>>fares.py at the python command line I get this message:

 

You can't call a Python program from the ">>>" prompt. That is the interactive Python window.

 

You would need to do Start > Run > type "cmd" and hit enter. This should bring you to the Windows command line. From there, you would type "python fares.py" to run the program. Or more likely:

 

python c:\python30\lib\fares.py (if that's where you put your script)

 

Or, you would "cd" to the "lib" directory first; that would save you from having to use the full path to your script.

 

Please try again and let me know how it goes.

 

To make it really simple, make a text file named something like: "print.py" with a single line: print 'Hello World.'

Then try to run that script. Be sure you can get that to work before trying to run the fares script. Be aware that some text editors like Notepad may add a *.txt extension you don't want to your *.py script.

 

One other thing to try. At the very bottom of your fares.py script (last line), add:

 

q = raw_input("Press any key to continue")

 

This should allow you to run the script by double-clicking it without having the window disappear.

 

Mike

Link to comment
Share on other sites

Isn't that half the fun, obsessive-compulsively check the prices on the website? If you really are compulsive you aren't going to trust the programs anyway.:D I never check after final payment. No need to get yourself disgusted.;)

 

 

I am glad I am not the only one that does that!! LOL :D I expect an email from RCI telling me to book it already LOL I check the website at least every day just to check it! That is half the fun!!!

Link to comment
Share on other sites

Ok. I guess I am making slow progress.

 

I was trying to run fares from the "run window" and python command line. Now I understand it should be from the cmd window.

 

I set up print.py The entire file is

print 'Hello World.'

 

I use editpad lite as my text editor and do not have a txt extension after the py

 

I opened the cmd window. did cd\pyton30 which put me in the directory for python and my *.py programs.

 

I typed at the

c:\Python30>python print.py

 

and got the following message:

File 'C:\Python30\print.py", line 1

print 'Hello World.'

SyntaxError: invalid syntax

 

A ^ appears under the ' after World.

 

While I was there I also tried:

c:\Python30>python fares.py

And got the following message:

Files "fares.py", line 27

current = time.tine()

IndentationError: expected an indented block

 

A ^ appears under the 't' for current.

 

Both print.py and fares.py run without python in front and I get the same messages. c:\Python30>fares.py and c:\Python30>print.py work without python entered, but, only the same results.

 

So, I've progressed from line 1 errors to line 27 errors. I would say I am making progress.

 

I did add

 

sys.exit()

q = raw_input("Press any key to continue")

 

as the last line.

 

the window still disappears. No log files are created.

 

Should I uninstall 3.0 and go back to 2.4? Would that be easier for you?

Link to comment
Share on other sites

Yup, I would definitely uninstall Python 3.0 and install the highest version of Python 2.4. I'd heard Python 3.0 was radically different than the others. If the script with the single "print" statement didn't work, absolutely nothing else will--"print" is the one of the most simple statements you can run in any programming language.

 

I misspoke on adding the line of code here:

 

sys.exit()

q = raw_input("Press any key to continue")

 

It should be the reverse--the "q" statement on top. I forgot I used the sys.exit(), which means the program never gets to the "q" statement. Or you could get rid of the sys.exit() line.

 

Also, you may want to google for PythonWin--this is a much better environment to fix errors with than the Python command line. Just get the version that corresponds to the Python 2.4 you install.

 

Sorry it's been a pain for you. I hope it's worthwhile once you get it working.

Link to comment
Share on other sites

Don't apologize. You've been very patient and I really appreciate your help. I do cruise quite a bit so I expect (hope) it will be worthwhile.

 

Ok. I uninstalled 3.0 and installed 2.4.4. Now print.py works. I corrected the directories for fares.py. But, I still get the same message

 

c:\Python24>python fares.py

And got the following message:

Files "fares.py", line 27

current = time.time()

^

IndentationError: expected an indented block

 

the ^ appears under the 't' for current.

Link to comment
Share on other sites

Mike,

I noticed that this board does not display indents. After reading a little about pyton, I figured that might have been part of the problem, so, I started playing with the indents.

 

WOW, what a temperamental language. But, I finally got a results log. It reported that it couldn't open the URL, so I am on to the next step.

 

I tested with some url's that definitely work, but, I keep getting the following report:

'Mon Jan 26 12:56:43 2009','Freedom031509','FAILED! Could not open URL',$899

 

I will play with some others, but, if you could offer some insights on this, I appreciate it.

Link to comment
Share on other sites

Sorry, I didn't realize tabs got deleted by CC's forum software. Yup, Python is very tempermental and the script won't work properly without the right indentation.

 

I made a screen shot of the parts of the script where there should be indentation, but the boards won't let me upload an image. It asks me for a URL, and I don't have any places I store images online. I don't know if email addresses are allowed, but if you post one I can email you text file with the proper indentation.

 

Whenever you see a colon ":", that typically indicates that the next line should have a tab, until the end of whatever coding structure it is. But sometimes there is nesting of indentation, where you'd add a second tab, etc. It can definitely be tricky.

 

As far as some URLs working and others not working, I don't know why that would happen. I would double-check that you copied the URL correctly, or... check to see if "session id" or something like that is in the URL. I have a feeling when you get deep enough on a booking, like if it asks you to hit "save", my script probably can't handle that--at that point, it's no longer a flat URL and is probably interacting with browser cookies or something on the server side. Is your URL at the level of where it lists one price "Starting from"? If it's deeper than that, it may not work. There may be a way around this by using non-RCCL web sites to track prices; like the one I posted previously on this thread.

 

You could always clear all your private info (like cookies) on your browser and try the URL again straight from your browser; or try a different browser. Any failure here means it will never work with the script.

 

Hope this helps some. The neat thing about Python is that you can try stuff out directly on the Python command line ">>>". For example, you could fire up Python at the command line, then type:

 

import urllib # then hit enter

p = urllib.urlopen("your URL here") # hit enter again

 

If Python doesn't complain, then your URL should be good. If it complains, then you need to find another URL.

 

You can also type: print p

... after that to see what the contents of the web page is.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Guest
This topic is now closed to further replies.
  • Forum Jump
    • Categories
      • Welcome to Cruise Critic
      • ANNOUNCEMENT: Set Sail on Sun Princess®
      • Hurricane Zone 2024
      • Cruise Insurance Q&A w/ Steve Dasseos of Tripinsurancestore.com June 2024
      • New Cruisers
      • Cruise Lines “A – O”
      • Cruise Lines “P – Z”
      • River Cruising
      • ROLL CALLS
      • Cruise Critic News & Features
      • Digital Photography & Cruise Technology
      • Special Interest Cruising
      • Cruise Discussion Topics
      • UK Cruising
      • Australia & New Zealand Cruisers
      • Canadian Cruisers
      • North American Homeports
      • Ports of Call
      • Cruise Conversations
×
×
  • Create New...