Braithwaite I/O

A Better Web Browser

15 December 2017

A better web browser with Jupyter Notebook, Selenium, and Readability.

 

Better Web Browser

A better web browser with Selenium and python-readability.

In [1]:
URL = 'https://theoutline.com/post/2604/star-wars-the-last-jedi-hype'
 

Download Website Content

Using Selenium we can extract website content from a Javascript website.

In [7]:
from contextlib import closing

from selenium.webdriver import Firefox
from selenium.webdriver.support.ui import WebDriverWait
In [8]:
with closing(Firefox()) as browser:
    browser.get(URL)
    
    WebDriverWait(browser, timeout=10).until(lambda x: x.find_element_by_tag_name('body'))
    
    content = browser.page_source
 

Extract Article Content

python-readability is a Python port of arc90's readability tool.

In [14]:
from readability import Document
In [32]:
article = Document(content)

print(article.title())
 
The right way to watch ‘Star Wars’: totally clueless | The Outline
 

Display Article Content

In [24]:
from IPython.core.display import display, HTML
In [34]:
display(HTML(article.summary()))
 

Like millions of Americans born since 1970, I am filled with warm, fuzzy memories of Star Wars. Luke Skywalker action figures lined my childhood bedroom, Slushie cups in the shape of Darth Vader’s head filled my kitchen, I played Dark Forces and Knights of the Old Republic and skipped my junior prom to watch all six films in a row, a test of endurance that promptly led me to come down with the flu and miss a week of school. There’s nothing unique about this; it was simply part of the firmament. It was more unusual to know somebody who hadn’t seen most or all of the movies, even if they couldn’t tell you about whether Greedo shot first.

Star Wars nostalgia is a lucrative business. In the next six months, the franchise will likely surpass Harry Potter to become the highest-grossing movie series of all-time. (I don’t count the Marvel Universe, like Wikipedia, because I’m not a masochist.) When Disney acquired the Star Wars properties back in 2012, and immediately announced plans for a new trilogy, they were making an immensely shrewd wager in an era where the box office is regularly dominated by corporately-owned intellectual properties. Studios spend millions on marketing just to re-familiarize audiences with rebooted concepts like the Lone Ranger and John Carter of Mars and Battleship, often to no avail. In Star Wars, Disney purchased the ur-text of geek culture, familiar to millions of now-grown dweebs looking for a simple, familiar escape at the movies.

Most importantly, Star Wars came back after online media had further pivoted toward predicative culture, where whole websites exist to endlessly speculate about what will happen next for some nerd franchise. Every photo posted to Instagram, every casting decision announced, every half-hidden remark uttered in an interview is fodder for a blog post to be eagerly consumed by readers sitting at their desks, looking for a way to pass the time. Star Wars is a self-sustaining content machine, with dozens of characters and plot lines to be discussed in the run-up to each new movie, all of it organic marketing for the studio. Disney can cut a cogent trailer, and sit back knowing that every website will rush to interpret it, disseminating the hype to thousands more fans.

This dynamic can be exhausting to anyone who logs on to read something original, and not just the same bit of information turned over by fifty websites with mildly varying tones. But worse: It actually diminishes your ability to enjoy the movie! There’s no doubt in my mind. When you’ve watched every trailer, when you’ve read every interview, when you’ve dissected every theory about character arcs and teaser photos, there’s little to be surprised by but for the actual sequencing of sounds and images you’ve already absorbed.

I enjoyed The Force Awakens, the first of the new Star Wars films, because I’m not ultra particular about well-crafted popcorn movies made for children. But I did remember sitting in the theater, mildly disappointed that I hadn’t done a better job insulating myself from all the pre-release speculation about Rey and Finn and Kylo Ren and whatever else. The point of going to movies like this is to hopefully be surprised into having a standalone good time, a rarity when so many franchise installments exist to set up the next franchise installment. Those moments of surprise become impossible when you’ve already consumed half the movie, in some way or another.

So ahead of The Last Jedi, the new Star Wars movie that will be released this weekend, I tried something I haven’t done with any modern nerd film: I stayed away. I didn’t read about any of the casting, even when I saw photos float around on Twitter. (Is Laura Dern in the movie?) I didn’t watch the trailer when it was released, or click on any articles breaking it down. I didn’t go out of my way to avoid any of this — when the trailer came on in a theater, I sat through it instead of running out. But it was alarmingly easy to avoid consuming all of this when I made the basic decision not to. The forces vying for our attentions can never be more successful than when we do the work for them — and by simply turning aside, we can actually increase the fun we have.

Would all culture be more enjoyable if we treated it like this? Well, yes. To me, Star Wars is unique because it so specifically triggers a lot of dormant, sentimental feelings related to my childhood, as I’m sure it does for many others. I once met a guy who tried to passionately argue that these feelings were just a Pavlovian reaction triggered by Disney’s soulless excavation of my nostalgia — to which I replied I didn’t particularly care. We all have these cultural madeleines, whose appeal is deeply embedded in our memory, and the sensation isn’t worth diluting through the consumption of so much anticipatory material.

A few years ago, I was out drinking the night before the release of The Force Awakens. I brought the movie up with a friend, who asked what I was talking about. It turned out that, somehow, he didn’t know the movie even existed — that Disney had bought these concepts, that they were planning new movies, that the first one was about to be released. I was mildly blown away that he, a self-described Star Wars fan, might have somehow missed the tonnage of marketing in the months before, designed to make young minds like his obsess over everything yet to come. But he said he was still going to see it, and I remember thinking he’d probably enjoy it more. (Update: The friend says he still hasn’t seen any of the new Star Wars, though he plans to “watch them in succession on Netflix soon.”) And if it's too late for you to check out The Last Jedi sight unseen, there's still one more movie left in the trilogy for you to cluelessly and joyfully experience.

In [ ]: