python-3.x - 奇怪的#HASHTAG 编码
问题描述
我遇到了奇怪的标签问题。它在 Instagram 帖子中使用,使其无法检测为标签,但看起来像一个标签。 https://www.instagram.com/p/6JomIetvLK/
尝试将该主题标签复制到谷歌。没有结果。我尝试复制到 python idle 和这个网站,但它会自动转换回正常的主题标签。
我正在尝试在 Instagram 上为我在 python 上的学校项目抓取字幕,这给我带来了问题。
with codecs.open(who+".txt", 'w') as outfile: #adding encoding='utf-8' doesn't help
dump = json.dump(oldData, outfile) #ensure_ascii doesn't help too
UnicodeEncodeError: 'charmap' codec can't encode characters in position 26-27: character maps to and yes.. 26-27 左右是那个奇怪的标签
有任何想法吗?我如何忽略/跳过 json.dump 中的字符?
解决方案
推荐阅读
- hibernate - 如何在 Spring Boot 运行时将数据库与存储在主数据库中的配置连接起来?
- timestamp - 如何解析 Skyfield 的时间戳?
- arrays - 在 Go 中初始化数组时使用传播
- python - 尝试打印列表时日文文本显示为乱码
- python - Django 模板 ajax 调用 api - int() 的无效文字,基数为 10:'[object Object]'
- amazon-web-services - 有没有办法使用可用的 API 打开 AWS 实例
- c++ - 在带有 ncurse 标头的终端中运行 main.cpp 文件
- visual-studio - 使用 Visual Basic 从总共 1400 万行代码中选择 1,000,000 行代码应该使用什么键盘快捷键?
- sql - 如何在 SQL Server SELECT 语句中获取先前的值
- r - 在函数中使用 geoms