問題描述
我一直在使用這些代碼在 Twitter 上大量關注/取消關注/收藏/取消收藏;
I have been mass following / unfollowing / favoriting / unfavoriting on twitter with these codes ;
$('button.follow-button').click();
$('button.ProfileTweet-actionButtonUndo').click();
$('a.favorite').click();
我在網上找到了一些不工作的代碼并嘗試修復,所以它們現在幾乎可以工作了.唯一的事情就是去谷歌瀏覽器上的頁面,按 f12 ,打開控制臺并運行命令.
I found some not-working codes online and tried to fix, so they are nearly working now. The only thing is to go to the page on google chrome, press f12 , open console and run the command.
所以現在,我想在 Vine 中使用相同的系統.谷歌瀏覽器有一個擴展來使用 vine ( https://client.vineclient.com/ ) 和我正在嘗試使用它,因為原始網頁( vine.co )甚至沒有用.
So now, I wanted to use the same system in Vine. There"s an extension for google chrome to use vine ( https://client.vineclient.com/ ) and I am trying to use it because original webpage ( vine.co ) is not even useful.
twitter 和this 的唯一區別是,在 vine 客戶端的 ^followers^ 部分中,頁面中會出現一個彈出窗口.而且我不知道它是否檢測到按鈕.
The only difference between twitter and this, is that, in vine client for ^followers^ section, an pop-up comes in the page. And I don!t know if it detects the buttons.
所以,我試圖從原始頁面點擊的按鈕的代碼,(我使用開發人員工具/元素獲取它)
So , the code of the button I am trying to click from original page , ( I took it using developer tools / elements )
<div class="user">
<img alt="Tu??e Nur TEK?N" class="avatar" src="http://v.cdn.vine.co/r/avatars/3C2E4F40F11066473630650847232_pic-r-1397241239141e51579937f.jpg.jpg?versionId=ttIz4CExCjW_4TEnxYbnehPPpXRyzMco">
<div class="wrapper">
<a class="username"
>
Tu??e Nur TEK?N
</a>
</div>
<a class="button follow" data-id="1066473613911363584">
<i class="icon">
</i>
</a>
</div>
要點擊的東西在這里:
當我手動點擊時,它會變成這樣:
When I manually click, it changes into this :
<a class="button unfollow" data-id="1066473613911363584"><i class="icon"></i></a>
以及我用來嘗試點擊的命令
And the command I use to try to click
$(".a.follow").click();
我得到的錯誤,
TypeError: Cannot read property 'click' of null
我該如何解決這個問題?順便說一句,在這些代碼中,我實際上找不到任何 ^button^ 代碼..謝謝!
How can I fix that? By the way, in these codes, I couldn"t find actually any ^button^ codes.. Thanks!
更新
- http://prntscr.com/3pmo2i
- http://prntscr.com/3pmoyk
- http://prntscr.com/3pmpym
推薦答案
我遇到了這個問題,當我從其他地方(例如 Selenium)在網頁上運行 javascript 同時使用開發者工具時.嘗試關閉開發者工具并運行腳本.
I had encountered this problem, when I run javascript on the webpage from elsewhere (eg. Selenium) while simultaneously using Developer Tools. Try closing Developer Tools and run the script.
這篇關于TypeError:無法讀取 null 的屬性“單擊"的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!