Code Monkey home page Code Monkey logo

student_tix_scanner's Introduction

๐ŸŽผ NY Classical Student Tickets Notifier

๐Ÿšจ THIS REPO NOW LARGELY DOESN'T WORK - but likely could be updated to continue being useful ๐Ÿšจ

I found myself periodically checking the websites for student tickets at the Met Opera, Carnegie Hall, and NY Phil -- and knew there had be a better way to find out about these awesome deals!

An hour later, I finished this quick and dirty scraper for the student tickets of the three aforementioned NYC classical music institutions.

No guarantee this will work at all for you! I just leave this script running in an infinite loop on a server so I'm always up to date (not the most elegant solution, sorry in advance).

Usage

python student_tix_scanner.py [email protected] -met -nyphil -carnegie

Built on Python 3.7 and Beautiful Soup4.

student_tix_scanner's People

Contributors

jmmanley avatar

Watchers

 avatar  avatar

student_tix_scanner's Issues

Carnegie Hall now blocks scraping with Incapsula

I tried naive approaches to mimic a realistic User-agent, but no luck:

opener = build_opener(HTTPCookieProcessor())
opener.addheaders=[('User-agent', 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36')]
response = opener.open('https://www.carnegiehall.org/Events/Discount-Programs/Student-Insider/Student-Discounts')
html = response.read()
print(html)
soup = bs(html, "html.parser")
divs = soup.findAll("div", {"class": "ch-events-list-item"})
print(len(divs))

returns:

b'<html>\r\n<head>\r\n<META NAME="robots" CONTENT="noindex,nofollow">\r\n<script src="/_Incapsula_Resource?SWJIYLWA=5074a744e2e3d891814e9a2dace20bd4,719d34d31c8e3a6e6fffd425f7e032f3">\r\n</script>\r\n<body>\r\n</body></html>\r\n'
0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.