Trouble with Selenium Python related Imports - python

I'm going to make an application using the Selenium WebDriver (python) and I was having trouble with some of the initial setup. I want to use the page object design pattern so I've been trying to import some materials in this way:
from page_objects import PageObject, PageElementfrom page_objects import PageObject, PageElement
as can bee seen in the documentation here: https://page-objects.readthedocs.io/en/latest/tutorial.html#a-simple-page-object
I'm using PyCharm for development and I've updated selenium and added it to the project interpreter but this import statement still will not work for me. I'm not sure which external module this import relates to or if its just some part of selenium, so any information would be greatly appreciated. Thanks!

That readthedocs is for the page_objects library, the repo for that library can be found here. You need to install that library before you can import it

Related

org.openqa.selenium.JavascriptExecutor could be resolved

I was trying to insert a js code into a website using selenium.
I know that I want to use the following import statement,
import org.openqa.selenium.JavascriptExecutor
But this was not installed,
"org.openqa.selenium.JavascriptExecutor" is not accessed
Import "org.openqa.selenium.JavascriptExecutor" could not be resolved
where to install the module or how to resolve the problem
You have tagged python and using the Selenium-Python clients you don't require any additional import other then from selenium import webdriver as both the methods to execute JavaScript synchronously and asynchronously i.e.
execute_script()
execute_async_script()
are supported out of the box.
Where as incase you are using the Selenium-Java clients you additionally need to import:
import org.openqa.selenium.JavascriptExecutor;

Python change app_name in win10toast

Recently i tried to make a toast notification i used the package win10toast.
Then i couldn't get rid of the "Python" app name at the top. If i compile it to an exe it says "yourapp.exe" is there a way to change that this is my code:
from win10toast import ToastNotifier
toaster = ToastNotifier()
toaster.show_toast("Test","Test",duration=10)
Here is a screenshot of how it looks:
I hope it is possible because i saw a application written in python that had the website url at the top. If there is no way to do that in win10toast is there a other library that can do that?
Would be amazing if someone could help me <3
I know I'm a little bit late and you've probably already moved on in your life, but I do know of a new module. My own! (Win10Toast) Unfortunately I haven't added capability to change the name, however you can use the updated version of Microsoft Toasts! It also allows you to put buttons on. You can check out Microsoft's page to see what can go in the XML and this StackOverflow page for how to use that XML in Python with the WinRT module.
I am planning on updating Win10Toast to use the WinRT module, but haven't gotten around to it yet.

Can't access Aliexpress functions in top.api

I'm just started to search Aliexpress-API documentation. In there: Developers.aliexpress , Im coding in python and need to import AliexpressSolutionProductPostRequest from top.api but it fails.
I installed top lib on Windows like that: python -m pip install top
Reinstalled twice but it fails. Its official website and fails. I can't figure it out.
AttributeError: module 'top.api' has no attribute 'AliexpressSolutionProductPostRequest'
This library has diffrent functions for Alibaba , not for aliexpres. Any suggestion for fix that ? Actually i can't find top library's offical documentation too.Thank you..
Okey. I found this library for fix that error. We need to install aliexpress-sdk:
pip install aliexpress-sdk
or (for pre-release):
pip install git+https://github.com/bayborodin/aliexpress-sdk
Now I can import Aliexpress modules which are in Aliexpress API Documentation.
Example module import for aliexpress:
from aliexpress.api import AliexpressSolutionProductPostRequest
I just learned offical way to do that.
After create an app on Aliexpress Console, you can generate API SDK for Python. In there you can find top library's functions which are in Aliexpress API Documentation. So we need to create App first, once accepted , we can do all these stuff.

How to resolve a RoboBrowser Import Error in Python?

I am a beginner trying to learn web scraping with python. I tried to import RoboBrowser module in Python 3.7.
When I install it using pip install robobrowser in the terminal, I get a list of 'Requirement already satisfied'. So I am assuming its installed properly.
However when I run from robobrowser import RoboBrowser in Python, its gives an import error as shown below.
ImportError: cannot import name 'cached_property' from 'werkzeug' (/Users/ashreetsangotra/opt/anaconda3/lib/python3.7/site-packages/werkzeug/__init__.py)
Here is the screenshot of the complete error for reference:
Click here for the screenshot Sorry Stack Overflow won't let me embed the screenshot directly as for now.
Please advice on how to proceed.
Ashreet Sangotra
Make sure your Werkzeug==0.16.1 version,
it will solve your error.
Thanks

Selenium / Python - No module named 'org'

I am trying to use the Select function in Selenium for Python 3 to help with navigating through the drop down boxes. However, when I try to import org.openqa.selenium.support.ui.Select I get an error message:
"No module named 'org'"
Would appreciate any help on this. I saw there was a similar question posted a few weeks ago but the link to that question is now broken. Thanks!
The path 'org.openqa.selenium.support.ui.Select' is a Java descriptor. In Python, make sure you have the Python Selenium module installed with pip install selenium, and then import it with import selenium.
For the Select function specifically, you can import that with the following
from selenium.webdriver.support.ui import Select
Then you'll be able to use it like this:
select = Select(b.find_element_by_id(....))

Categories