The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
http://creativecommons.org/publicdomain/zero/1.0/deed.enCC0Creative Commons Zero, Public Domain Dedicationfalsefalse
from bs4 import BeautifulSoup
import requests
prefix = "http://filmindonesia.or.id/movie/title/list/year/"
year_start = 1926
year_end = 2017
def getSoup(url):
res = requests.get(url)
try:
res.raise_for_status()
except Exception as exc:
print('There was a problem: %s' % (exc))
return BeautifulSoup(res.text, 'html.parser')
for year in range(year_start, year_end+1):
url = prefix + str(year)
soup = getSoup(url)
h4s = soup.findAll("h4")
if len(h4s) == 0:
print(str(year) + ": " + str(0))
continue
txt = h4s[0].text
dashIndex = txt.index("-")+2
entriStart = txt.index("entri", dashIndex)
num = txt[dashIndex:entriStart]
print(str(year) + " " + str(num))
gnuplot script to generate chart
set terminal svg size 600,400 enhanced fname 'arial' fsize 10 butt solid
set output 'out.svg'
set style line 1 lc rgb '#8b1a0e' pt 6 ps 1 lt 1 lw 2 # --- red
set nokey
set style line 11 lc rgb '#808080' lt 1
set tics nomirror
set grid
plot "data.txt" using 1:2 with lines
Captions
Add a one-line explanation of what this file represents