jcontini / google-keep-csv Goto Github PK
View Code? Open in Web Editor NEWExport Google notes to CSV (via Google Takeout)
License: MIT License
Export Google notes to CSV (via Google Takeout)
License: MIT License
Keep/2018-12-06T21_15_37.264+01_00.html
Traceback (most recent call last):
File "/home/mick/projects/google-keep-scraper/keep.py", line 22, in
xlDate = datetime.strftime(parse(googDate), '%m/%d/%Y %H:%M')
File "/home/mick/.local/lib/python2.7/site-packages/dateutil/parser/_parser.py", line 1358, in parse
return DEFAULTPARSER.parse(timestr, **kwargs)
File "/home/mick/.local/lib/python2.7/site-packages/dateutil/parser/_parser.py", line 649, in parse
raise ValueError("Unknown string format:", timestr)
ValueError: (u'Unknown string format:', u'6 dic. 2018 21:15:37')
From what @jcontini reported on jcontini/facebook-friends-map#2:
One thing I noticed - for notes with checkboxes, the output now puts the checkbox after the text instead of before.
After looking a bit further, it is due to the HTML structure of Google Takeout's notes:
<body>
<div class="note">
<div class="heading">7 avr. 2016 à 21:12:13</div>
<div class="title">ToMake</div>
<div class="content">
<div class="listitem">
<div class="bullet">☐</div>
<div class="text">URL Shortner</div>
</div>
<div class="listitem">
<div class="bullet">☐</div>
<div class="text">Torrent downloader</div>
</div>
</div>
</div>
</body>
As you can see the bullet
divs are placed before the text
divs, which explains why getText()
returns the checkboxes before the associated text. The checkboxes are not after their text, but actually at the end of the line before their text (this is why the first line has only a checkbox and the last line has none).
However, I see no change in jcontini/facebook-friends-map#2 that could have caused this change. I can't try the former version as my Takeout data is localised in French, but can you checkout 73a1f9e and run the script to see if the issue was there before my PR? I can't spend more time investigating this for now, but maybe this issue is anterior to those changes?
by the way,
in "google keep archive" each note corresponds to one html file.
Could you please write a script that would save all these single html files (notes) into one big html file?
(while keeping the original CSS styles formatting)
It should be simple, just read that <div>
where the note is, and append it to one file...
But I'm not a programmer, though.
Thanks.
Hey @jcontini ,
Thanks for the great work on this. I was trying to implement the same, but at the last step, after running the "python keep.py" it shows this message.
Keep#Studioबिम्ब.html
Traceback (most recent call last):
File "C:\Users\user\Downloads\Keep Html\google-keep-csv-master\keep.py", line 42, in
writer.writerow([file, note["date"], note["title"], note["content"]])
File "c:\users\user\appdata\local\programs\python\python39\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 12-16: character maps to
Although a CSV file is generated, it is entirely empty. Could you suggest a workaround? Thanks! :)
Hello,
I've got this error, not sure what it means:
Traceback (most recent call last):
File "keep.py", line 21, in <module>
soup = bs4.BeautifulSoup(page.read(), "html.parser")
File "C:\Python\lib\encodings\cp1250.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x88 in position 11215: character maps to <undefined>
Hello,
MacOS 10.15.5
Python 3.8.1
I keep getting the following error. I tweaked things a bit but haven't been able to have the script working:
Keep/archive_browser.html Traceback (most recent call last): File "keep.py", line 24, in <module> googDate = soup.select(".heading")[0].getText().strip() IndexError: list index out of range
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.