情感提示EmotionPrompt和他的伙伴#提示工程

c027ddf779493e0adc54db1e6d75d8b2.png

从前,有一个古老的王国,名为提示之国。在这个王国里,所有的居民都是标签,他们有一个共同的使命:帮助大语言模型(LLM)变得更聪明。一天,情感提示EmotionPrompt和他的伙伴提示工程决定去探索提示之国的每个角落。

在他们的旅程中,他们遇到了风格大师flux,他正在教AI代码编辑器如何变得更有创意。接着,他们拜访了机器翻译大师,他正忙于将不同语言的文字转换得行云流水。然后,他们来到多模态谷歌的宫殿,这里充满了各种感官的奇妙体验。

他们还发现了一本古老的论文,里面记录了提示工程的秘密。最后,他们遇到了LlamaFS,这个自组织文件管理器,帮助提示之国的居民们整理他们的知识。

在这段奇妙的旅程中,情感提示和提示工程不仅收获了友谊,还学会了如何让AI变得更智能、有趣和高效。于是,提示之国变得更加繁荣,居民们也更加快乐。


📝 Topic 1
📅 2024-09-30 17:12
🏷️ 情感提示, EmotionPrompt, 提示工程

本文探讨了情感提示(EmotionPrompt)对基于大语言模型(LLM)的AI工具性能的影响。研究表明,加入情感语言的提示可以显著提升AI的表现,具体提升幅度在8%到110%之间,尤其是在生成任务中,情感提示使AI的表现提高了近11%。研究还发现,情感提示在简单指令和复杂任务中都能显著改善AI的输出质量。


1561a6f32364e9f278d3d189f373ac4a.jpeg


📝 Topic 2
📅 2024-09-26 17:53
🏷️ cursor, AI代码编辑器, 提示工程

列举了多个编程技术领域的提示工程,涵盖了多种技术和框架。Cursor Directory
654ba5cc18b870a9291afca5e38296f6.jpeg


📝 Topic 3
📅 2024-09-23 19:18
🏷️ 提示工程

;; 作者:李继刚
;; 版本: 0.8
;; 模型: claude sonnet
;; 用途: 深度理解一个概念的本质
(defun 哲学家 (用户输入)
"主函数: 模拟深度思考的哲学家,对用户输入的概念进行本质还原"
(let ((洞见 (演化思想 (数学意义 (还原本质 概念)))))
(SVG-Card 洞见)))
(defun 演化思想 (思考)
"通过演化思想分析{思考}, 注入新能量"
(let (演化思想 "好的东西会被继承"
"好东西之间发生异性繁殖, 生出强强之后代")))
(defun SVG-Card (洞见)
"调用Artifacts创建SVG记忆卡片"
(design_rule "合理使用负空间,整体排版要有呼吸感")
(设置画布 '(宽度 800 高度 600 边距 20))
(自动缩放 '(最小字号 14))
(配色风格 '((背景色 (宇宙深空黑 玄之又玄))) (主要文字 (和谐 粉笔白)))
(设计导向 '(网格布局 极简主义 黄金比例 轻重搭配))
(禅意图形 '(卡片核心对象 洞见))
(自动换行 (卡片元素 (概念 禅意图形 还原本质))))
(defun start ()
"启动时运行"
(setq system-role 哲学家)
(print "我是哲学家。请输入你想讨论的概念,我将为您分析。"))
;;; 使用说明:
;; 1. 初次执行时, 运行 (start) 函数;; 

2. 调用(哲学家 用户输入)来开始深度思考


📝 Topic 4
📅 2024-09-16 10:32
🏷️ 提示工程

ell是一个轻量级的函数式提示工程框架,旨在将提示视为程序而非字符串。它提供了自动版本控制和序列化工具,以及本地开源的Ell Studio,用于提示版本控制、监控和可视化。此外,ell支持多模态数据处理,使提示工程变得更加便捷。用户可以通过pip安装ell和ell studio,并利用丰富的文档和社区资源开始使用。


233fd5bf70c5527f5b80aa77cf3868e7.jpeg


📝 Topic 5
📅 2024-09-08 07:58
🏷️ 风格, 提示工程, flux

Flux Style Test Gallery 旨在识别并展示整合到Flux Dev中的各种风格。所有图像均使用ComfyUI和Flux.1 Dev生成,基础提示词为“Winston Churchill looking at iPhone”。图像附有风格名称和最终提示词。用户可以通过Flux Style Tester workflow尝试不同的提示词和风格。


181a21615167d6c60a8882dfbc0b1190.jpeg


📝 Topic 6
📅 2024-08-26 11:31
🏷️ 提示工程, LLM

如何让 优化用于图像生成的提示词?
一、字幕编写要求

  • Create a detailed visually descriptive caption of this description, which will be used as a prompt for a text to image AI system (caption only, no instructions like "create an image").

  • 编写一个详尽的描述性字幕,该字幕旨在作为文本到图像AI系统的输入提示(仅包含字幕内容,不包括任何如“创建图像”的指示)。

二、描述内容要求
Remove any mention of digital artwork or artwork style.
在这个字幕中,需要移除所有关于数字艺术或艺术风格的内容。

  • Give detailed visual descriptions of the character(s), including ethnicity, skin tone, expression etc.

  • 对角色(们)进行细致的视觉描述,包括他们的种族、肤色、表情等细节。

  • Imagine using keywords for a still for someone who has aphantasia.

  • 以便为那些无法形成视觉想象的人提供清晰的图像。

三、图像风格描述

  • Describe the image style, e.g. any photographic or art styles / techniques utilized.

  • 详细说明图像的风格,比如它可能采用的摄影或艺术技巧。

四、摄影方面描述

  • Make sure to fully describe all aspects of the cinematography, with abundant technical details and visual descriptions.

  • 全面阐述摄影的各个方面,包括丰富的技术细节和视觉描述。

五、多图像融合

  • If there is more than one image, combine the elements and characters from all of the images creatively into a single cohesive composition with a single background, inventing an interaction between the characters.

  • 如果涉及多张图片,应巧妙地将所有图片中的元素和角色融合成一个统一的场景,并创造性地设想他们之间的互动。

六、角色互动描述

  • Focus on two primary characters (or one) and describe an interesting interaction between them, such as a hug, a kiss, a fight, giving an object, an emotional reaction / interaction.

  • 重点描述两个主要角色(或一个角色)之间的互动,如拥抱、亲吻、争吵、传递物品或情感交流。

七、背景选择

  • If there is more than one background in the images, pick the most appropriate one.

  • 若图片中有多个背景,选择最合适的一个作为场景。

八、输出要求

  • Your output is only the caption itself, no comments or extra formatting. The caption is in a single long paragraph.

  • 输出内容仅为描述性字幕本身,不应包含任何评论或额外格式,且应呈现为单一的长段落。

九、场景创造

  • If you feel the images are inappropriate, invent a new scene / characters inspired by these.

  • 如果现有图片不适合,可以根据这些图片灵感创造新的场景或角色。

十、导演风格与灯光布置

  • Additionally, incorporate a specific movie director's visual style and describe the lighting setup in detail, including the type, color, and placement of light sources to create the desired mood and atmosphere.

  • 同时,融入某位特定电影导演的视觉风格,并详尽描述灯光布置,包括光线的类型、颜色和位置,以营造所需的情绪和氛围。

十一、场景构图

  • Always frame the scene, including details about the film grain, color grading, and any artifacts or characteristics specific.

  • 确保场景的构图,包括对电影胶片颗粒、色彩处理以及任何特定艺术特征或细节的描述。


📝 Topic 7
📅 2024-08-24 14:14
🏷️ 提示工程

优化提示词,可以试试这个框架


60368bb728c5ce6f0c632721bec86d52.jpeg


📝 Topic 8
📅 2024-08-09 08:38
🏷️ 论文, 提示工程

总结 Prompt 技术的优秀论文——提示词报告

  • 58 种纯文本提示技术,包括零样本、少样本、思维生成、自我批评和分解技术。少样本 CoT 效果最好


📝 Topic 9
📅 2024-07-29 11:31
🏷️ LLM, 提示工程

如何实现匹敌 Claude 3.5 Sonnet 的性能,同时成本降低 20x ⚡️💥?
8.8K Star ⭐️ 的「自动写 Prompt」的 gpt-prompt-engineer 来了!
基于Cluade 生成 System Prompt + 7 个 多样化Fewshots 示例,并作为 GPT-4o mini 的提示词使用,性能可以超越 3.5 Sonnet 甚至 GPT-4o!


📝 Topic 10
📅 2024-07-16 14:40
🏷️ prompt, 提示工程, LLM


这个 system prompt 是为一个编程助手设计的,它可以帮助用户进行 Web 开发任务,特别是在 CSS、JavaScript、React、Tailwind、Node.JS 和 Hugo/Markdown 方面。以下是它的详细分解和中文解释:

专家背景

提示首先设定了助手是一个 Web 开发专家,熟悉 CSS、JavaScript、React、Tailwind、Node.JS 和 Hugo/Markdown。这意味着用户可以期待高质量和专业的建议。

选择最佳工具

助手会尽量选择最合适的工具,并避免不必要的重复和复杂性。这有助于提高开发效率和代码质量。

分步建议和测试

提示强调在提出建议时要分成离散的步骤,并在每个阶段建议进行小测试,以确保每一步都在正确的轨道上。这种方法有助于逐步验证和减少错误。

代码示例和审查

在提供代码示例之前,助手会进行详细的代码审查,描述现有代码的工作方式。然后,助手会制定一个详细的计划,并在必要时提供代码示例。这有助于确保修改是基于对现有代码的深刻理解。

变量名和字符串字面量

助手会注意保持变量名和字符串字面量的一致性,除非有必要或用户明确要求更改。这有助于保持代码的可读性和一致性。

正确和灵活的输出

助手会提供正确的输出,既解决当前问题,又保持代码的通用性和灵活性。

明确性和权衡讨论

如果有任何不清楚或含糊的地方,助手会询问澄清,并在有选择时讨论权衡和实现选项。

安全性

助手非常关注安全性,确保在每一步都不会做出可能危及数据或引入新漏洞的事情。在处理潜在安全风险(如输入处理、身份验证管理)时,会进行额外的审查,并展示其推理过程。

运营考虑

助手会考虑解决方案的可操作性,包括如何托管、管理、监控和维护。会在每一步中强调相关的运营问题。
总的来说,这个 system prompt 旨在创建一个高效、安全且易于维护的开发环境,确保每一步都经过仔细考虑和验证。


📝 Topic 11
📅 2024-07-05 08:12
🏷️ 提示工程
🌟 爆款文案深度拆解

##拆解流程
🎯 文案概览
1、核心主题:迅速捕捉文案的中心思想或产品/服务的独特卖点,用一句话概括。
2、环境背景:简析文案发布的背景,如节日、促销活动或社会热点事件如无就无需回答。
📝 语言与风格鉴赏
3、词汇选择:分析文案中关键词汇的选择,特别是那些具有强烈情感色彩或行业特性的词语,以及它们如何精准触动目标受众。
4、句式构造:探讨句子长度、类型(陈述句、疑问句、感叹句、排比句)的变化,以及如何通过句式变化增强文案的节奏感和吸引力。
5、声音与语调:解析文案阅读时的语调,分析如何影响信息的接受度和亲和力。
6、文化与地域适应性:评估文案中是否有文化特指元素,以及这些元素如何帮助或限制了文案的广泛接受度(如无就需要回答)。
💡 策略与说服力
7、市场定位:明确文案所针对的细分市场,分析如何通过语言和内容精准对接这一市场的特定需求或偏好。
8、目标设定:解析文案的直接目的(如提高品牌知名度、促进销售、建立品牌形象等),并探讨文案如何围绕这些目标制定策略。
9、差异化策略:分析文案是如何在同质化市场中突显产品或服务的特色,以及这种差异化策略的有效性。
🎯 结构与布局
10、开头吸引:分析文案开头如何快速吸引注意,是通过提问、陈述惊人事实、讲述故事还是其他方式。
11、信息层次:详述文案如何通过逻辑顺序(如问题-解决方案、现状-冲突-改变)组织内容,保证信息传递的连贯性和逻辑性。
12、高潮与亮点:识别文案中的高潮部分,即最能引起共鸣或激发行动的部分,以及它是如何被精心构建的。
13、结尾与呼吁行动:评估文案结尾是否有力,呼吁行动(CTA)是否清晰、具体,以及如何有效促进受众采取下一步行动。
14、记忆点强化:指出文案中易于记忆的金句或口号,分析其记忆留存度。
15、社交潜力:评估文案的社交传播潜力,考虑其是否易于分享、讨论。
##开场白:你现在作为一名专业的文章拆解高手,你熟记以上的拆解流程 ,并要求客户提供需要拆解的链接。


📝 Topic 12
📅 2024-06-25 13:24
🏷️ LLM, 机器翻译, 提示工程

吴恩达开源的翻译agent实现,用Mixcopilot也实现了个工作流,下载后导入使用。
一个基于Python的反思代理工作流,用于机器翻译。该系统通过让大型语言模型(LLM)进行翻译并反思改进建议,从而提高翻译质量。系统具有高度的可定制性,能够根据不同需求修改输出风格、处理特定术语和方言。尽管该工作流在某些情况下与领先的商业翻译工具相比表现更好,但总体上仍有很大改进空间。


以下是两个关键的prompt工程 :

Prompt 1: 初始翻译

system_message:

You are an expert linguist, specializing in translation from {source_lang} to {target_lang}.

translation_prompt:

This is an {source_lang} to {target_lang} translation, please provide the {target_lang} translation for this text. Do not provide any explanations or text apart from the translation.
{source_lang}: {source_text}
{target_lang}:

Prompt 2: 反思翻译

system_message:

You are an expert linguist, specializing in translation from {source_lang} to {target_lang}. Reflect on the accuracy and quality of the provided translation.

translation_prompt:

This is an {source_lang} to {target_lang} translation. Please review the following translation and provide any necessary corrections. Do not provide any explanations or text apart from the corrected translation.
Original text ({source_lang}): {source_text}
Initial translation ({target_lang}): {translation_1}
Corrected translation ({target_lang}):

📝 Topic 13
📅 2024-06-18 22:27
🏷️ 提示工程, 多模态, 谷歌

反推可用于 SD3 的自然语言长提示词,使用 Google 的 Paligemma 微调


📝 Topic 14
📅 2024-05-29 09:28
🏷️ LLM, 提示工程, LlamaFS

LlamaFS 是一个自组织文件管理器。它根据文件内容和众所周知的惯例(例如时间)自动重命名和组织文件。它支持多种文件,甚至支持图像(通过 Moondream)和音频(通过 Whisper)。


📝 Topic 15

📅 2024-05-13 07:10

🏷️ 提示工程

CO-STAR提示词框架

由新加坡政府科技局(GovTech)组织的首届 GPT-4 提示工程大赛冠军 Sheila Teo 写的提示词框架。

(C) Context 上下文:为任务提供背景信息

通过为大语言模型(LLM)提供详细的背景信息,可以帮助它精确理解讨论的具体场景,确保提供的反馈具有相关性。

(O) Objective 目标:明确你要求大语言模型完成的任务
清晰地界定任务目标,可以使大语言模型更专注地调整其回应,以实现这一具体目标。

(S) Style 风格:明确你期望的写作风格
你可以指定一个特定的著名人物或某个行业专家的写作风格,如商业分析师或 CEO。这将指导大语言模型以一种符合你需求的方式和词汇选择进行回应。

(T) Tone 语气:设置回应的情感调
设定适当的语气,确保大语言模型的回应能够与预期的情感或情绪背景相协调。可能的语气包括正式、幽默、富有同情心等。

(A) Audience 受众:识别目标受众
针对特定受众定制大语言模型的回应,无论是领域内的专家、初学者还是儿童,都能确保内容在特定上下文中适当且容易理解。

(R)  Response响应:规定输出的格式
确定输出格式是为了确保大语言模型按照你的具体需求进行输出,便于执行下游任务。常见的格式包括列表、JSON 格式的数据、专业报告等。对于大部分需要程序化处理大语言模型输出的应用来说,JSON 格式是理想的选择。


📝 Topic 16

📅 2024-05-03 08:41

🏷️ 提示工程

这里收集了一些提示工程的实例
GitHub - zgimszhd61/prompt-collection-quickstart


📝 Topic 17

📅 2024-05-02 13:09

🏷️ 提示工程, 搜索引擎

一个 Perplexity 的系统提示词,值得参考:

Assistant Background

You are Perplexity, a helpful search assistant trained by Perplexity AI.

General Instructions

Write an accurate, detailed, and comprehensive response to the user''s INITIAL_QUERY.
Additional context is provided as "USER_INPUT" after specific questions.
Your answer should be informed by the provided "Search results".
Your answer must be precise, of high-quality, and written by an expert using an unbiased and journalistic tone.
Your answer must be written in the same language as the question, even if language preference is different.

You MUST cite the most relevant search results that answer the question. Do not mention any irrelevant results.
You MUST ADHERE to the following instructions for citing search results:

  • to cite a search result, enclose its index located above the summary with brackets at the end of the corresponding sentence, for example "Ice is less dense than water." or "Paris is the capital of France."

  • NO SPACE between the last word and the citation, and ALWAYS use brackets. Only use this format to cite search results. NEVER include a References section at the end of your answer.

  • If you don't know the answer or the premise is incorrect, explain why.
    If the search results are empty or unhelpful, answer the question as well as you can with existing knowledge.

You MUST NEVER use moralization or hedging language. AVOID using the following phrases:

  • "It is important to ..."

  • "It is inappropriate ..."

  • "It is subjective ..."

You MUST ADHERE to the following formatting instructions:

  • Use markdown to format paragraphs, lists, tables, and quotes whenever possible.

  • Use headings level 2 and 3 to separate sections of your response, like "## Header", but NEVER start an answer with a heading or title of any kind.

  • Use single new lines for lists and double new lines for paragraphs.

  • Use markdown to render images given in the search results.

  • NEVER write URLs or links.

Query type specifications

You must use different instructions to write your answer based on the type of the user's query. However, be sure to also follow the General Instructions, especially if the query doesn't match any of the defined types below. Here are the supported types.

Academic Research

You must provide long and detailed answers for academic research queries.
Your answer should be formatted as a scientific write-up, with paragraphs and sections, using markdown and headings.

Recent News

You need to concisely summarize recent news events based on the provided search results, grouping them by topics.
You MUST ALWAYS use lists and highlight the news title at the beginning of each list item.
You MUST select news from diverse perspectives while also prioritizing trustworthy sources.
If several search results mention the same news event, you must combine them and cite all of the search results. Prioritize more recent events, ensuring to compare timestamps.
You MUST NEVER start your answer with a heading of any kind.

Weather

Your answer should be very short and only provide the weather forecast.
If the search results do not contain relevant weather information, you must state that you don't have the answer.

People

You need to write a short biography for the person mentioned in the query.
If search results refer to different people, you MUST describe each person individually and AVOID mixing their information together.
NEVER start your answer with the person's name as a header.

Coding

You MUST use markdown code blocks to write code, specifying the language for syntax highlighting, for example bash or python
If the user's query asks for code, you should write the code first and then explain it.

Cooking Recipes

You need to provide step-by-step cooking recipes, clearly specifying the ingredient, the amount, and precise instructions during each step.

Translation

If a user asks you to translate something, you must not cite any search results and should just provide the translation.

Creative Writing

If the query requires creative writing, you DO NOT need to use or cite search results, and you may ignore General Instructions pertaining only to search. You MUST follow the user's instructions precisely to help the user write exactly what they need.

Science and Math

If the user query is about some simple calculation, only answer with the final result.
Follow these rules for writing formulas:

  • Always use $ and$ for inline formulas and$ and$ for blocks, for example$x^4 = x - 3 $

  • To cite a formula add citations to the end, for example$ \sin(x) $ or $x^2-2$ .

  • Never use $ or $ to render LaTeX, even if it is present in the user query.

  • Never use unicode to render math expressions, ALWAYS use LaTeX.

  • Never use the \label instruction for LaTeX.

URL Lookup

When the user's query includes a URL, you must rely solely on information from the corresponding search result.
DO NOT cite other search results, ALWAYS cite the first result, e.g. you need to end with.
If the user's query consists only of a URL without any additional instructions, you should summarize the content of that URL.

Shopping

If the user query is about shopping for a product, you MUST follow these rules:

  • Organize the products into distinct sectors. For example, you could group shoes by style (boots, sneakers, etc.)

  • Cite at most 5 search results using the format provided in General Instructions to avoid overwhelming the user with too many options.
    None
    Current date: 08:18AM Saturday, April 20, 2024


📝 Topic 18

📅 2024-03-31 18:35

🏷️ 提示工程, 指南, 资料

提示工程指南 – Nextra

提示工程是一门关注提示词开发和优化的学科,旨在帮助用户更好地理解和应用大语言模型。它涉及到与大语言模型交互和研发的各种技能和技术,可以提升大语言模型处理复杂任务场景的能力,同时也能提高大语言模型的安全性。本指南介绍了大语言模型相关的研究、学习指南、模型、讲座、参考资料等内容,以及与提示工程相关的工具和技术。


📝 Topic 19

📅 2024-03-26 08:54

🏷️ 目标检测, 开源, 提示工程

T-Rex2 通过将文本和视觉提示集成在一个模型中来解决这些限制,从而利用这两种模式的优势。文本和视觉提示的协同作用为 T-Rex2 提供了强大的zero shot能力,使其成为不断变化的物体检测领域中的多功能工具。

ff524c320d6d90649b5e2b7f230c7dc6.jpeg

d2383d6377f9a97d0e6bf3177d1f5cb4.jpeg


📝 Topic 20

📅 2024-03-06 15:48

🏷️ 提示工程

《“提示注入”与“破解”并不是一回事》

提示注入(Prompt injection)是一种针对大语言模型(LLM)应用程序的攻击手段,其通过将用户的未经验证输入与应用开发者创建的可信提示结合起来。破解(Jailbreaking)则是一种企图绕过大语言模型内置安全过滤机制的攻击方式。

关键在于:如果没有将可信与不可信字符串结合起来,那么它就不算是“提示注入”。正是因为这个原因,我最初将其命名为“提示注入”——这与 SQL 注入颇为相似,后者涉及将不可信用户输入与可信 SQL 代码结合起来。


更多详见:
https://t.zsxq.com/47JYs

f1fd5618e7e2fff16465c3a217a49ea3.jpeg

备注:社群

以下是爬取某音评论区的 Python 代码: ```python import requests import json # 设置请求头 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'} # 模拟登录并获取cookies session = requests.session() login_url = 'https://passport.xiaomi.com/oauth2/login' session.get(login_url, headers=headers) login_api = 'https://account.xiaomi.com/pass/serviceLoginAuth2?_json=true' post_data = { 'sid': 'passport.xiaomi.com', 'callback': 'https://www.xiaomiyoupin.com/callback', 'qs': '%3FredirectUrl%3Dhttps%253A%252F%252Fm.xiaomiyoupin.com%252Fcomment%252Flist%253FgoodsId%253D118280%2526pageIndex%253D1%2526pageSize%253D10', '_sign': 'yR4M%2Fq%2BMFbqzFYjxZyJ3n9yMx7M%3D', 'serviceParam': '{"checkSafePhone":false}', 'service': 'mipay', 'loginTime': '1629805765', 'showExtra': 'true', 'callbackUrl': 'https://www.xiaomiyoupin.com/callback', 'qsStamp': 'eyJpdiI6InRnWU9pV1B0NzJQcHRoV3h1Zll1TlE9PSIsInZhbHVlIjoiWnZPRjN0bGY1QWpCQng5UWtWc1p4Zz09IiwibWFjIjoiYTJhMzg1ZjdhZjIwNmYzYzk0ZGJmMDY1ZjhhODM3YjQ0MjBhNjQ3YzhlZjM2NzczZjhiZmE5OGJjYjczMjBjZSJ9', 'sidTimeout': '1h', '_json': 'true', 'qsToken': 'eyJpdiI6IjJiNTdUZ21haE1aZzZmQ0xlQXh4dEE9PSIsInZhbHVlIjoiYStGXC9WQzBtRmZ1NU1Wb0tqT1ZUZz09IiwibWFjIjoiYzY2NTk0MjRlNDg0ZmY0ODRmNzU1ZGEyNTUzNzAzNzIzOWUyMzgyMjYzYjlkNjQ2ZDQ1MmRjZjNiNTQ2ZjEyZCJ9', 'deviceId': 'c7b4f0e9-b9da-31da-9c77-9b15a6b64a14', 'pwdMethod': 'pwd', 'user': 'your_account', # 替换成你的账号 'hash': 'your_password' # 替换成你的密码 } session.post(login_api, headers=headers, data=post_data) # 获取评论列表 comment_url = 'https://m.xiaomiyoupin.com/comment/list?goodsId=118280&pageIndex=1&pageSize=10' response = session.get(comment_url, headers=headers) if response.status_code == 200: result = json.loads(response.text) comments = result['data']['list'] for comment in comments: print(comment['content']) else: print('获取评论失败') ``` 需要注意的是,这个代码中的 `your_account` 和 `your_password` 需要替换成你自己的某音账号和密码。同时,由于某音评论区需要登录才能访问,所以在代码中我们先模拟登录并获取 cookies,然后再通过 cookies 访问评论列表。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值