批量生成公众号内容
批量生成公众号内容
批量生成公众号内容 批量生成公众号内容 Modified July 21, 2025 Code block Python Copy 运行结果: 检索框中没有任何内容。大胆猜测没有定位到检索框的位置。 6、定位到检索框,提示词如下: Code block SQL Copy @perplexity selenium.py L108 目前输入框的前端代码是:<textarea placeholder="Ask anything…" class="overflow auto max h [45vh] lg:max h [40vh] sm:max h [25vh] outline none w full font sans caret superDuper resize none selection:bg super/50 selection:text textMain dark:selection:bg superDuper/10 dark:selection:text superDark dark:bg offsetDark dark:text textMainDark dark:placeholder textOffDark placeholder:select none bg background text textMain placeholder textOff scrollbar thumb idle dark:scrollbar thumb idleDark scrollbar thin scrollbar track transparent" autocomplete="off" rows="2" id="ask input" data 1p ignore="true" style="height: 48px !important;" </textarea 。请根据此选择合适的。 Windsurf 生成内容: 部分修改代码: Code block Plain Text Copy search box = wait.until(EC.element to be clickable((By.ID, "ask input"))) 运行结果: 实现了预期效果:打开 perplexity 了并输入了检索内容,完成检索。 目前缺少的是选择模型和导出功能。 7、点击选择模型,提示词如下: 提示词的核心内容(自己实际操作选择模型的过程): Code block Plain Text Copy @perplexity selenium.py L108 目前点击页面的内容是<选择模型的长条出的前端代码1 ,其中我需要选择的是<选择模型第一次要点击的位置处的前端代码2 ,,需要对这个位置进行点击。 上面的 1,2 的位置如下图所示: 完整版内容如下,其实看上面的内容就够了。 Code block XML Copy @perplexity selenium.py L108 目前点击页面的内容是<div class="bg background dark:bg offsetDark flex items center justify self end rounded full col start 3 row start 2 mr 1" <div style="opacity: 1;" <span <button aria label="Choose a model" type="button" class="focus visible:bg offsetPlus dark:focus visible:bg offsetPlusDark hover:bg offsetPlus text textOff dark:text textOffDark hover:text textMain dark:hover:bg offsetPlusDark dark:hover:text textMainDark max w 24 sm:max w none font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div class="flex shrink 0 items center justify center size 4" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke width="1.7999999999999998" stroke linecap="round" stroke linejoin="round" class="tabler icon tabler icon cpu " <path d="M5 5m0 1a1 1 0 0 1 1 1h12a1 1 0 0 1 1 1v12a1 1 0 0 1 1 1h 12a1 1 0 0 1 1 1z" </path <path d="M9 9h6v6h 6z" </path <path d="M3 10h2" </path <path d="M3 14h2" </path <path d="M10 3v2" </path <path d="M14 3v2" </path <path d="M21 10h 2" </path <path d="M21 14h 2" </path <path d="M14 21v 2" </path <path d="M10 21v 2" </path </svg </div </div </button </span </div <span <button type="button" class="focus visible:bg offsetPlus dark:focus visible:bg offsetPlusDark hover:bg offsetPlus text textOff dark:text textOffDark hover:text textMain dark:hover:bg offsetPlusDark dark:hover:text textMainDark px [4px] font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div <div class="my xs flex items center" <div class="flex items center gap 2" <div class="relative flex items center justify center rounded full size 6" style="z index: 0;" <div class="flex size 5 items center justify center" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke width="1.7999999999999998" stroke linecap="round" stroke linejoin="round" class="tabler icon tabler icon world " <path d="M3 12a9 9 0 1 0 18 0a9 9 0 0 0 18 0" </path <path d="M3.6 9h16.8" </path <path d="M3.6 15h16.8" </path <path d="M11.5 3a17 17 0 0 0 0 18" </path <path d="M12.5 3a17 17 0 0 1 0 18" </path </svg </div </div </div </div </div </div </button </span <div class="flex items center" <div data state="closed" <div style="opacity: 1;" <span <button aria label="Attach files" type="button" class="focus visible:bg offsetPlus dark:focus visible:bg offsetPlusDark hover:bg offsetPlus text textOff dark:text textOffDark hover:text textMain dark:hover:bg offsetPlusDark dark:hover:text textMainDark font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div class="flex shrink 0 items center justify center size 4" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke width="1.7999999999999998" stroke linecap="round" stroke linejoin="round" class="tabler icon tabler icon paperclip " <path d="M15 7l 6.5 6.5a1.5 1.5 0 0 0 3 3l6.5 6.5a3 3 0 0 0 6 6l 6.5 6.5a4.5 4.5 0 0 0 9 9l6.5 6.5" </path </svg </div </div </button </span </div <input multiple="" accept=".pdf,.txt,.py,.ipynb,.js,.jsx,.html,.css,.java,.cs,.php,.c,.cpp,.cxx,.h,.hpp,.rs,.R,.Rmd,.swift,.go,.rb,.kt,.kts,.ts,.tsx,.m,.scala,.rs,.dart,.lua,.pl,.pm,.t,.sh,.bash,.zsh,.csv,.log,.ini,.config,.json,.yaml,.yml,.toml,.lua,.sql,.bat,.md,.coffee,.tex,.latex,.less,.pptx,.docx,.xlsx,.jpeg,.jpg,.jpe,.jp2,.png,.gif,.bmp,.tiff,.tif,.svg,.webp,.ico,.avif,.heic,.heif,.mp3,.wav,.aiff,.ogg,.flac,.mp4,.mpeg,.mov,.avi,.flv,.mpg,.webm,.wmv,.3gp" type="file" style="display: none;" </div </div <div class="relative" <button aria label="Dictation" type="button" class="focus visible:bg offsetPlus dark:focus visible:bg offsetPlusDark hover:bg offsetPlus text textOff dark:text textOffDark hover:text textMain dark:hover:bg offsetPlusDark dark:hover:text textMainDark font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div class="flex shrink 0 items center justify center size 4" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="none" class="tabler icon tabler icon microphone filled " <path d="M19 9a1 1 0 0 1 1 1a8 8 0 0 1 6.999 7.938l .001 2.062h3a1 1 0 0 1 0 2h 8a1 1 0 0 1 0 2h3v 2.062a8 8 0 0 1 7 7.938a1 1 0 1 1 2 0a6 6 0 0 0 12 0a1 1 0 0 1 1 1m 7 8a4 4 0 0 1 4 4v5a4 4 0 1 1 8 0v 5a4 4 0 0 1 4 4" </path </svg </div </div </button </div <div class="ml 2" <button aria label="Voice mode" type="button" class="bg super dark:bg superDark dark:text backgroundDark text white hover:opacity 80 font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div class="flex shrink 0 items center justify center size 4" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" color="currentColor" fill="currentColor" fill rule="evenodd" <path d="M0 12.6663C0 13.4018 0.59792 13.9997 1.33333 13.9997C2.06875 13.9997 2.66667 13.4018 2.66667 12.6663V11.333C2.66667 10.5975 2.06875 9.99967 1.33333 9.99967C0.59792 9.99967 0 10.5975 0 11.333V12.6663ZM6.66667 5.33301C7.40213 5.33301 8 5.93087 8 6.66634V17.333C8 18.0685 7.40213 18.6663 6.66667 18.6663C5.9312 18.6663 5.33333 18.0685 5.33333 17.333V6.66634C5.33333 5.93087 5.9312 5.33301 6.66667 5.33301ZM10.6667 21.333C10.6667 22.0685 11.2645 22.6663 12 22.6663C12.7355 22.6663 13.3333 22.0685 13.3333 21.333V2.66634C13.3333 1.93093 12.7355 1.33301 12 1.33301C11.2645 1.33301 10.6667 1.93093 10.6667 2.66634V21.333ZM17.3333 5.33301C18.0688 5.33301 18.6667 5.93087 18.6667 6.66634V17.333C18.6667 18.0685 18.0688 18.6663 17.3333 18.6663C16.5979 18.6663 16 18.0685 16 17.333V6.66634C16 5.93087 16.5979 5.33301 17.3333 5.33301ZM24 11.333C24 10.5975 23.4021 9.99967 22.6667 9.99967C21.9312 9.99967 21.3333 10.5975 21.3333 11.333V12.6663C21.3333 13.4018 21.9312 13.9997 22.6667 13.9997C23.4021 13.9997 24 13.4018 24 12.6663V11.333Z" </path </svg </div </div </button </div </div ,其中我需要选择的是<div style="opacity: 1;" <span <button aria label="Choose a model" type="button" class="focus visible:bg offsetPlus dark:focus visible:bg offsetPlusDark hover:bg offsetPlus text textOff dark:text textOffDark hover:text textMain dark:hover:bg offsetPlusDark dark:hover:text textMainDark max w 24 sm:max w none font sans focus:outline none outline none outline transparent transition duration 300 ease out font sans select none items center relative group/button justify center text center items center rounded lg cursor pointer active:scale [0.97] active:duration 150 active:ease outExpo origin center whitespace nowrap inline flex text sm h 8 aspect [9/8]" data state="closed" <div class="flex items center min w 0 font medium gap 1.5 justify center" <div class="flex shrink 0 items center justify center size 4" <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke width="1.7999999999999998" stroke linecap="round" stroke linejoin="round" class="tabler icon tabler icon cpu " <path d="M5 5m0 1a1 1 0 0 1 1 1h12a1 1 0 0 1 1 1v12a1 1 0 0 1 1 1h 12a1 1 0 0 1 1 1z" </path <path d="M9 9h6v6h 6z" </path <path d="M3 10h2" </path <path d="M3 14h2" </path <path d="M10 3v2" </path <path d="M14 3v2" </path <path d="M21 10h 2" </path <path d="M21 14h 2" </path <path d="M14 21v 2" </path <path d="M10 21v 2" </path </svg </div </div </button </span </div ,需要对这个位置进行点击。 Windsurf 生成内容: 运行结果: 可以弹出模型选择页面。 看完给出的修改内容: //button[@aria label='Choose a model'] 感觉可能不太通用 8、点击模型的实现更加通用性,提示词如下: Code block Plain Text Copy @perplexity selenium.py L111 113 这个没有通用性,如果现在不是Choose a model,还有其他的,都是不相同的。有其他的方案么 Windsurf 生成内容: 运行结果: 完美匹配更加普遍的方式弹出模型选择页面。 9、根据弹出的内容,选择 Claude 模型,提示词如下: Code block Plain Text Copy @perplexity selenium.py L145 149 弹出的页面中的前端代码是:<弹出框的所有前端代码1 ,我需要选择的是:<选择的Claude模型的前端代码2 ,然后对这个进行点击。 上面的 1,2 的位置如下图所示: 完整的内容如下: Code block XML Copy @perplexity selenium.py L145 149 弹出的页面中的前端代码是:<div class="flex h full flex col" <div class="scrollbar thin scrollbar track transparent scrollbar thumb idle dark:scrollbar thumb idleDark min h 0 flex 1 overflow auto" <div class="p xs" <div class="group/item md:h full" <div class="relative select none rounded lg transition all duration 300 px sm py 1.5 md:h full hover:bg offset dark:hover:bg offsetDark cursor pointer" <div class="flex gap sm" <div class="flex 1" <div class="flex flex col gap y 0.5" <div class="flex items center gap x 1.5 font sans text xs font medium text super dark:text superDark selection:bg super/50 selection:text textMain dark:selection:bg superDuper/10 dark:selection:text superDark" <span Best</span </div <div class="whitespace pre wrap font sans text xs font normal text textOff dark:text textOffDark selection:bg super/50 selection:text textMain dark:selection:bg superDuper/10 dark:selection:text superDark" Selects the best model for each query</div </div </div </div </div </div <div class="sm:mx sm my sm border t border