loadsofthem
Newbie
- Aug 1, 2016
- 18
- 6
I'm creating a mailing bot with ubot, but i have a problem when gathering my friends, because there is a button that has to be clicked, so there appear more friends. the probem is that ajax detects that i'm a robot, and the the button that loads more friends, begins to stay frozen for longer periods of time each time is clicked. An then, when the bot tries to click the button, it shows and error about jar and i can only scrape 415 users, and this when making it wat 20 seconds for the button, if i make the button wait 60 secons it gathers 715 users before crashing. when i open the page in a browser and i click by myself it lods after 5 seconds all the times.
I already use the javascript:
run javascript("window.scrollTo(0,document.body.scrollHeight);")
but it it just scrolls the page to the button.
I found atutorial in google that uses this phython code to scrape pages:
run python("import mechanize
import urllib2
import time
from selenium import webdriver
from selenium common exceptions import NoSuchAttributeException
from selenium.webdriver.common.keys import Keys
import os
import re
br.set_handle_robots(false)
br.set_handle_refresh(false)
br.addheaders=[(\'user-agent\'),(\'chrome\')]")
But when i try to run the scripts, it shows me errors all the time.
I already use the javascript:
run javascript("window.scrollTo(0,document.body.scrollHeight);")
but it it just scrolls the page to the button.
I found atutorial in google that uses this phython code to scrape pages:
run python("import mechanize
import urllib2
import time
from selenium import webdriver
from selenium common exceptions import NoSuchAttributeException
from selenium.webdriver.common.keys import Keys
import os
import re
br.set_handle_robots(false)
br.set_handle_refresh(false)
br.addheaders=[(\'user-agent\'),(\'chrome\')]")
But when i try to run the scripts, it shows me errors all the time.
- Does somebody know an alternative way to prevent to load more button from doing this? (I does it provably because it detects a bot)
- How can i do to insert python code in ubot so it does not have errors?