Closed sakarimov closed 4 years ago
Hi @sakarimov I will help you with this. I know that the documentation is missing, but let's fix it.
In order to use this tool, you need to set up two things:
Now let's go to code. You have to create a python file, in the examples, you have a file that you can use. In this file, you have to create a CreatorStudio object, and you have to pass to it the way you want to login. You have two options to login(choose one).
cs_cli = CreatorStudio("YOUR_EMAIL", "YOUR_PASSWORD")
cs_cli.login()
cs_cli = CreatorStudio("YOUR_EMAIL", "YOUR_PASSWORD", browser_profile_path="/home/arielsperduti/.mozilla/firefox/5gs2k9uib.default-release/")
cs_cli.login()
Here you have to set up correctly browser_profile_path with the value where is stored you Firefox session.
And to start posting, just:
cs_cli.create_post(account=<Your instagram account/facebook page>,
message=<message>,
file=<Full path to a photo>,
schedule_options={
"date": <MM/DD/YYYY>,
"time": <H:MM A/P>
},
social_network="instagram")
Also, I made a small update to the code, because there was a change with the interface. Update it before to try all this. And tell me what's happen.
thanks..., let me try it, i'll post what i get
i logged in my account and defined browser_profile_path i still get this error
Traceback (most recent call last):
File "from_csv.py", line 9, in
Yes, I made a mistake, things that happen when you try to code fast and don't test... Now it should be fixed. I hope are no more mistakes xD.
Please, update your repo and tell me how it is going.
i'm sorry my bad, i also don't read the error, it says invalid: SyntaxError, i just changed it and it is loged now
Close on #4
i guess it's because the app failed to catch facebook login button in the first place, then directly catch instagram button
this is what i get in my terminal
User is logged Timeout Exception in explicit wait Traceback (most recent call last): File "./from_csv.py", line 15, in
cs_cli.create_post(account=post[0],
File "/home/cikapc/creator-studio-cli/creator_studio/creator_studio.py", line 31, in create_post
instagram.create_post(self.browser, account, message, file, schedule_options=schedule_options)
File "/home/cikapc/creator-studio-cli/creator_studio/instagram.py", line 33, in create_post
create_post_button = browser.find_element_by_xpath(xpath["instagram"][create_post.name]["create_post_button"])
File "/home/cikapc/creator-studio-cli/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 394, in find_element_by_xpath
return self.find_element(by=By.XPATH, value=xpath)
File "/home/cikapc/creator-studio-cli/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 976, in find_element
return self.execute(Command.FIND_ELEMENT, {
File "/home/cikapc/creator-studio-cli/venv/lib/python3.8/site-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "/home/cikapc/creator-studio-cli/venv/lib/python3.8/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //div[text()='Create Post']