314ma

PGE

Jun 5th, 2020
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import xml.etree.ElementTree as ET
  2. import requests
  3. response = requests.get('https://pgedystrybucja.pl/planowanewylaczenia/wylaczenia/Mi%C5%84sk-Mazowiecki')
  4. fixedText = response.text.replace("<td style>", "<td>").replace("<br>", "").replace("<br />", "").replace("</table>", "</tbody></table>")
  5. tree = ET.fromstring(fixedText)
  6. for tr in tree[0][1]:
  7.     if len(tr) > 1:
  8.         print(tr[4].text)
RAW Paste Data