Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,741 members, 7,817,049 topics. Date: Saturday, 04 May 2024 at 12:59 AM

Python Automation Programmers Please Help! - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Python Automation Programmers Please Help! (1056 Views)

Top 10 Python Automation Projects Aspirants Should Try / Programmers, Please Your Golden Advise Is Needed / Programmers, Please Recommend A Good Laptop For Me. (2) (3) (4)

(1) (Reply) (Go Down)

Python Automation Programmers Please Help! by hassinho707(m): 10:35pm On Dec 31, 2020
I'm writing a script that can open an Android app and play videos one after the other continuously via bluestacks emulator.
I have written a code that can write the name of the app in the search bar below, close to start button.. I am using Windows 10...
After searching the app, the pyautogui has not been able to locate the screenshot. I used pyautogui.locatescreenshot('C:\\photo.png) , but is it saying the file is empty.
I used snipping tool to screenshot the image as I was unable to screenshot using pyautogui.screenshot('screenshot_example.png')
So the code that I have now can type and search out the app, but can't open or click it...
I'm sorry if my explanation is wrong... I'm new to programming, as a matter of fact I just enrolled for Automate the boring task course in Udemy....

below is the code that I have written

MODIFIED

import pyautogui
import time
time.sleep(2)

while True:
pyautogui.click(x=175, y=749)
pyautogui.typewrite("My App", interval=0.1)
pyautogui.click(1568, 789)


I used pyautogui.locateOnScreen('C:\\odan.png') , but it says the image file is empty.....

I tried looking for the solution on youtube but to no avail...

Please help! I want to automate an app on PC via buestacks using Python
Re: Python Automation Programmers Please Help! by stanliwise(m): 11:07pm On Dec 31, 2020
hassinho707:
I am currently writing a script to automate an app on PC via bluestacks emulator... and after writing this,

import pyautogui
import time
time.sleep(2)

while True:
pyautogui.click(x=175, y=749)
pyautogui.typewrite("My App", interval=0.1)
pyautogui.click(1568, 789) I used pyautogui.locateOnScreen('C:\\odan.png') , but it says the image file is empty.....

I tried looking for the solution on youtube but to no avail...

Please help! I want to automate an app on PC via buestacks using Python
Next time learn how to be descriptive with your problem.
What exactly is your project about? (Aside it being an automation app, what should it be doing?)
What is your current problem?
What have your tried?
Lastly explain any code you post!
Hian!
Re: Python Automation Programmers Please Help! by jesmond3945: 12:29am On Jan 01, 2021
hassinho707:
I am currently writing a script to automate an app on PC via bluestacks emulator... and after writing this,

import pyautogui
import time
time.sleep(2)

while True:
pyautogui.click(x=175, y=749)
pyautogui.typewrite("My App", interval=0.1)
pyautogui.click(1568, 789) I used pyautogui.locateOnScreen('C:\\odan.png') , but it says the image file is empty.....

I tried looking for the solution on youtube but to no avail...

Please help! I want to automate an app on PC via buestacks using Python
use // instead
Re: Python Automation Programmers Please Help! by hassinho707(m): 1:55am On Jan 01, 2021
stanliwise:

Next time learn how to be descriptive with your problem.
What exactly is your project about? (Aside it being an automation app, what should it be doing?)
What is your current problem?
What have your tried?
Lastly explain any code you post!
Hian!

Thanks boss for your interest....

I'm writing a script that can open an Android app and play videos one after the other continuously via bluestacks emulator.

I have written a code that can write the name of the app in the search bar below, close to start button.. I am using Windows 10...

After searching the app, the pyautogui has not been able to locate the screenshot. I used pyautogui.locatescreenshot('C:\\photo.png) , but is it saying the file is empty.

I used snipping tool to screenshot the image as I was unable to screenshot using pyautogui.screenshot('screenshot_example.png')

So the code that I have now can type and search out the app, but can't open or click it...

I'm sorry if my explanation is wrong... I'm new to programming, as a matter of fact I just enrolled for Automate the boring task course in Udemy....
Re: Python Automation Programmers Please Help! by Nobody: 12:06pm On Jan 01, 2021
hassinho707:


Thanks boss for your interest....

I'm writing a script that can open an Android app and play videos one after the other continuously via bluestacks emulator.

I have written a code that can write the name of the app in the search bar below, close to start button.. I am using Windows 10...

After searching the app, the pyautogui has not been able to locate the screenshot. I used pyautogui.locatescreenshot('C:\\photo.png) , but is it saying the file is empty.

I used snipping tool to screenshot the image as I was unable to screenshot using pyautogui.screenshot('screenshot_example.png')

So the code that I have now can type and search out the app, but can't open or click it...

I'm sorry if my explanation is wrong... I'm new to programming, as a matter of fact I just enrolled for Automate the boring task course in Udemy....
If I understand your post. What you want to create is a bot that watch videos?
That's why you're running it on BlueStacks..
If that is the case you'll need to work with requests. Install fiddler on your machine and inspect the traffic. (There is a way to limit traffic to only your emulator on fiddler)
That will help you understand how to send your request.
Re: Python Automation Programmers Please Help! by stanliwise(m): 1:56pm On Jan 01, 2021
hassinho707:


Thanks boss for your interest....

I'm writing a script that can open an Android app and play videos one after the other continuously via bluestacks emulator.

I have written a code that can write the name of the app in the search bar below, close to start button.. I am using Windows 10...

After searching the app, the pyautogui has not been able to locate the screenshot. I used pyautogui.locatescreenshot('C:\\photo.png) , but is it saying the file is empty.

I used snipping tool to screenshot the image as I was unable to screenshot using pyautogui.screenshot('screenshot_example.png')

So the code that I have now can type and search out the app, but can't open or click it...

I'm sorry if my explanation is wrong... I'm new to programming, as a matter of fact I just enrolled for Automate the boring task course in Udemy....
Ok now I get an idea of what you’re doing. But let me ask

why ‘C://‘ and not ‘C:/‘ ?
Please check documentation page or online to be sure the file exist.
Re: Python Automation Programmers Please Help! by og2021: 11:56pm On Jan 01, 2021
onecoder:

If I understand your post. What you want to create is a bot that watch videos?
That's why you're running it on BlueStacks..
If that is the case you'll need to work with requests. Install fiddler on your machine and inspect the traffic. (There is a way to limit traffic to only your emulator on fiddler)
That will help you understand how to send your request.

Really? Please show me how.... I have already installed fiddler, but I don't know how to use it.... As a matter of fact, I'm hearing of it for the first time.....
Please teach me.

I JUST CREATED THIS DOMAIN... I HAVE BEEN HAVING PROBLEM COMMENTING ON THIS THREAD....
Re: Python Automation Programmers Please Help! by og2021: 11:59pm On Jan 01, 2021
stanliwise:

Ok now I get an idea of what you’re doing. But let me ask

why ‘C://‘ and not ‘C:/‘ ?
Please check documentation page or online to be sure the file exist.


It tried it, but it didn't work. The file is still empty... Please can you try it on your PC and see?
Re: Python Automation Programmers Please Help! by hassinho707(m): 10:00am On Jan 02, 2021
onecoder:

If I understand your post. What you want to create is a bot that watch videos?
That's why you're running it on BlueStacks..
If that is the case you'll need to work with requests. Install fiddler on your machine and inspect the traffic. (There is a way to limit traffic to only your emulator on fiddler)
That will help you understand how to send your request.
Bro please can I have your phone number? or you can add me on WhatsApp with mine....080
Re: Python Automation Programmers Please Help! by Nobody: 10:45am On Jan 02, 2021
hassinho707:
Bro please can I have your phone number? or you can add me on WhatsApp with mine....
To be honest all u want is on YouTube. I can't actually help you learn virtually.
When you're stuck ask questions.

I can point you to a sample code though if ur bot needs login/logout functionality
Re: Python Automation Programmers Please Help! by hassinho707(m): 11:00am On Jan 02, 2021
onecoder:

To be honest all u want is on YouTube. I can't actually help you learn virtually.
When you're stuck ask questions.

I can point you to a sample code though if ur bot needs login/logout functionality
Thanks so much bro, I really appreciate
Re: Python Automation Programmers Please Help! by stanliwise(m): 11:57am On Jan 02, 2021
og2021:



It tried it, but it didn't work. The file is still empty... Please can you try it on your PC and see?
file empty or does not exist?
Re: Python Automation Programmers Please Help! by bedfordng(m): 5:49pm On Jan 02, 2021
hassinho707:
Bro please can I have your phone number? or you can add me on WhatsApp with mine..
i cant really say much about desktop automation because i mostly use selenium and beautifulsoup for web automation but why not try pyautoit instead. its also another pretty module you can use.

by the way, have you tried the normal Python with open function and use that variable for the screenshot.

also, which coding environment are you using for the project.
Re: Python Automation Programmers Please Help! by hassinho707(m): 7:34pm On Jan 02, 2021
bedfordng:
i cant really say much about desktop automation because i mostly use selenium and beautifulsoup for web automation but why not try pyautoit instead. its also another pretty module you can use.

by the way, have you tried the normal Python with open function and use that variable for the screenshot.

also, which coding environment are you using for the project.
I haven't tried pyautoit... I will try it and see...

I also haven't used the normal Python...

I am using pycharm...
Re: Python Automation Programmers Please Help! by bedfordng(m): 8:59pm On Jan 02, 2021
hassinho707:
I haven't tried pyautoit... I will try it and see...

I also haven't used the normal Python...

I am using pycharm...
that's what I mean. pycharm is an IDE which is mostly recommended for python coding. so its cool. just try autoit module and see how it goes.
Re: Python Automation Programmers Please Help! by hassinho707(m): 6:29am On Jan 26, 2021
onecoder:

To be honest all u want is on YouTube. I can't actually help you learn virtually.
When you're stuck ask questions.

I can point you to a sample code though if ur bot needs login/logout functionality
Please can you help me with some YouTube video links ... I don't even know where to start from....

(1) (Reply)

AFRICAN PROGRAMMERS Whatsapp Group / Where Can I Get Raspberry Pi 3 In Lagos / Challenge For Excel Users/enthusiast And All Distinguished Data Analyst

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 37
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.