openai-cookbook icon indicating copy to clipboard operation
openai-cookbook copied to clipboard

'charmap' codec can't encode characters in position 455-456: character maps to

Open hp191220 opened this issue 1 year ago • 1 comments

Tried adding arguement encode="utf-8", in open statement but could not execute program. After adding arguement encode it gives this error

OSError Traceback (most recent call last) Cell In[37], line 136 133 queue.append(link) 134 seen.add(link) --> 136 crawl(full_url)

Cell In[37], line 115, in crawl(url) 112 print(url) # for debugging and to see the progress 114 # Save text from the url to a .txt file --> 115 with open('text/'+local_domain+'/'+url[8:].replace("/", "_") + ".txt", "w",encoding="utf-8") as f: 116 117 # Get the text from the URL using BeautifulSoup 118 soup = BeautifulSoup(requests.get(url).text, "html.parser") 120 # Get the text but remove the tags

hp191220 avatar Apr 23 '23 15:04 hp191220

Tried adding arguement encode="utf-8", in open statement but could not execute program. After adding arguement encode it gives this error

OSError Traceback (most recent call last) Cell In[37], line 136 133 queue.append(link) 134 seen.add(link) --> 136 crawl(full_url)

Cell In[37], line 115, in crawl(url) 112 print(url) # for debugging and to see the progress 114 # Save text from the url to a .txt file --> 115 with open('text/'+local_domain+'/'+url[8:].replace("/", "_") + ".txt", "w",encoding="utf-8") as f: 116 117 # Get the text from the URL using BeautifulSoup 118 soup = BeautifulSoup(requests.get(url).text, "html.parser") 120 # Get the text but remove the tags

If anyone resolved this problem then please help me.

hp191220 avatar Apr 23 '23 15:04 hp191220

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Sep 28 '23 01:09 github-actions[bot]

This issue was closed because it has been stalled for 10 days with no activity.

github-actions[bot] avatar Oct 08 '23 01:10 github-actions[bot]