msaldivar msaldivar - 23 days ago 7
Python Question

python searching allflicks (a website) to see if a show is on netflix

I want to sharpen my python skills and build a program that would use http://www.allflicks.net/ to search for a given title and return if it is available on netflix. Since netflix has removed access to their public api I need to figure out how to search for the show inside allflicks and return the results. The issue I'm having is the way allflicks works is as the name of the show is being typed a list is being narrowed based on the input.

The examples I've seen on here and other websites assume the websites search box will automatically take you to the results once you fill the search box and do .click, but this isn't working for me. Any ideas on a specific library I might need, or any general advice would be extremely helpful. Thank you.

Answer

You want to intercept the requests your browser is making so that you can view them. There should be a request that searches for the movies based on the name. You can then use urllib or a package like requests to make the same request from inside Python. You can then interpret this request to determine whether or not the movie is on Netflix.

You may want to look into an intercepting proxy or a browser addon that will allow you to take a look at the requests and responses for your browser.

In firefox you can use Tamper Data, an add on that lets you capture outgoing requests.

A quick peak at allflicks.com shows me that a request is sent out every time you type into the search box. The response is labelled as text/html, but it appears to actually be JSON. Each request has a ton of query parameters on it, but the important one is search_value or something similarly named.

Comments