imacros FireFox:无法在任何记录模式下复制本网站按钮 [英] imacros FireFox: Cannot replicate this website button press in any record mode
问题描述
手动这样做直接把你带到那个艺术家的页面。播放时的所有录制模式无法复制。记录下的按钮按钮不会进入艺术家页面,而是进入搜索结果页面。点击第一个结果也是可以接受的,但是这个按钮有同样的问题。重播记录的点击只会重新加载搜索结果页面。 (在结果页面上以红色标出)
最后几行(全部注释掉)表示第一个选项的记录按钮(搜索抽屉内的第一个结果按钮)。我尝试了所有可用的记录模式和xpath选项,只要我能弄清楚。我已经在这个问题上花了一个星期的时间,阅读了超过一百页的信息,我发现任何人遇到这种行为都没有提到,更不用说想办法解决了。
比开心地买一个品脱,并且为那些可以伸出援助之手的好撒玛利亚人分配一个业力之星。我应该提到的网站需要登录,但任何随机信息将做,并让你在几秒钟内没有验证。宏只假定一个词的艺术家名字只有大写首字母。
SET歌手Chromeo
URL GOTO = https://play.spotify.com/browse
WAIT SECONDS = 3
EVENT TYPE = CLICK SELECTOR =#nav-searchBUTTON = 0
WAIT SECONDS = 2
FRAME F = 1
EVENTS TYPE = KEYPRESS SELECTOR =HTML> BODY> DIV> FORM> INPUTCHARS = {{artist}}
WAIT SECONDS = 3
'CLICK X = 173 Y = 188
'EVENT TYPE = MOUSEUP POINT =(136,180)
'TAG POS = 1 TYPE = A ATTR = DRAGGABLE:true&& DATA-DRAG-TEXT:{{艺术家}}&& DATA-URI:spotify:artist:*
'TAG POS = 1 TYPE = A ATTR = TXT:
'TAG XPATH =(/ html / body / div [3 ] $ / pre
$ b $ p $ >另外,如果有帮助,这里是由萤火虫(xpath上面也通过萤火虫)检索的按钮的HTML: < ; a draggable =truedata-drag-text =Chromeodata-uri =spotify:artist:2mV8aJphiSHYJf43DxL7Gt>
< / a>
为了简单起见,我已经从实际上是.js脚本中提取了这个,所以如果有的话在js的方式,这是多余的欢迎。
解决方案我没有检查我的代码,因为不能用任意随机信息登录本网站。因此,请尝试以下建议:
$ p $ lt; code> SET artist Chromeo
SET selArtista [draggable = true] [data-drag
EVENT TYPE = CLICK SELECTOR = {{selArtist}} BUTTON = 0
或者这三个事件而不是 CLICK
:
TAG POS = 1 TYPE = A ATTR = DRAGGABLE:true&& DATA-DRAG-TEXT:{{artist}}&& DATA-URI:spotify :艺术家:* CONTENT = EVENT:MOUSEOVER
EVENT TYPE = MOUSEDOWN SELECTOR = {{selArtist}} BUTTON = 0
EVENT TYPE = MOUSEUP SELECTOR = {{selArtist}} BUTTON = 0
FF 42.0 / Imacros for FF BUILD=8940826 / 2.8Ghz 8 core Early 2008 MacPro / OSX 10.8.2
PROBLEM: After clicking on the search icon on Spotify's web player, a drawer opens which contains the search field. Enter a search term, and buttons appear below the search field within the drawer. I want to press the first button for top results which is the artist page for the most direct search hit (outlined in green).
Doing so manually takes you directly to that artist's page. ALL of the recording modes when played back fail to replicate this. Instead of going to the artist page, the recorded button presses bring you to a search results page. Clicking the first result there would be acceptable too, but this button has the same issue. Replaying recorded clicks only reloads the search results page. (outlined in red on results page)
The last few lines (all commented out) represent the recorded button press for the first option (first top results button within search drawer) I tried all available recording modes plus xpath option as far as I was able to figure that out. I have spent a week on this issue now, read well over a hundred pages of info, and I can find no mention anywhere of anyone encountering this behavior, let alone figuring out how to solve it.
MORE than happy to buy a pint and assign a karmic gold star to any good samaritan out there who can lend a hand. I should mention site requires login, but any random info will do and get you on in seconds with no verification. Macro assumes one word artist name with capitalized first letter only.
SET artist Chromeo
URL GOTO=https://play.spotify.com/browse
WAIT SECONDS=3
EVENT TYPE=CLICK SELECTOR="#nav-search" BUTTON=0
WAIT SECONDS=2
FRAME F=1
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV>FORM>INPUT" CHARS={{artist}}
WAIT SECONDS=3
'CLICK X=173 Y=188
'EVENT TYPE=MOUSEUP POINT="(136,180)"
'TAG POS=1 TYPE=A ATTR=DRAGGABLE:true&&DATA-DRAG-TEXT:{{artist}}&&DATA-URI:spotify:artist:*
'TAG POS=1 TYPE=A ATTR=TXT:
'TAG XPATH="(/html/body/div[3]/div[1]/div[1]/ul[1]/li/a)"
Also, if helpful, here is the html for the button as retrieved by firebug (xpath above also via firebug):
<a draggable="true" data-drag-text="Chromeo" data-uri="spotify:artist:2mV8aJphiSHYJf43DxL7Gt">
</a>
For simplicity, I have extracted this from what is actually a .js script, so if there is some way around this in js, that is more than welcome as well.
I didn’t check my code because can’t log in this site with "any random info". So try the following suggestion:
SET artist Chromeo
SET selArtist "a[draggable=true][data-drag-text={{artist}}][data-uri^='spotify:artist:']"
EVENT TYPE=CLICK SELECTOR={{selArtist}} BUTTON=0
or this three events instead of CLICK
:
TAG POS=1 TYPE=A ATTR=DRAGGABLE:true&&DATA-DRAG-TEXT:{{artist}}&&DATA-URI:spotify:artist:* CONTENT=EVENT:MOUSEOVER
EVENT TYPE=MOUSEDOWN SELECTOR={{selArtist}} BUTTON=0
EVENT TYPE=MOUSEUP SELECTOR={{selArtist}} BUTTON=0
这篇关于imacros FireFox:无法在任何记录模式下复制本网站按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!