Checkpoint - implementing the scrapper (WIP)

This commit is contained in:
Suwako Moriya 2018-11-05 22:50:53 +01:00
parent a402eb154e
commit 1588ae2140

19
fetch.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Nov 5 20:55:36 2018
@author: suwako
"""
import requests
def runfetch(url):
session=requests.Session()
req1=session.get(url)
text=req1.text.split('\n')
text='\n'.join(text[text.index('<br/>ANNEXES<br/>ANNEXE I</p>'):text.index('<div style="margin-top: 30px; margin-bottom:20px;" id="JORFSCTA000037493059" class="titreSection">Annexe </div>'):]).split('<tr>')[2::]
for row in text:
pass
if __name__ == '__main__':
runfetch('https://www.legifrance.gouv.fr/eli/arrete/2018/10/12/PRMD1824595A/jo/texte')