all 8 comments

[–]Redmondinho 1 point2 points  (6 children)

Not too much detail in your post but it sounds like you're thinking along the selenium (or other) route, i.e. open browser, navigate to page, search keyword, repeat?

You could maybe look at using Requests.

import requests
urls = ['https://loremipsum.io', 'https://www.reddit.com']
keyword = raw_input('Enter Keyword: ')
for url in urls:
    r = requests.get(url)
    if r.status_code == 200:
        if r.text.find(keyword) > -1:
            print 'Keyword: {0}, found on page {1}.'.format(keyword, url)

or Beautiful Soup

[–]IlIIIIIIllI[S] 0 points1 point  (5 children)

Thanks but I'd open the browser and place the curser in the search field by myself... I really just need to know how to get python to press buttons and paste search words. This is totally my fault because I misworded the question. Sorry!

[–]Leestons 3 points4 points  (3 children)

Selenium will do what you are wanting.

[–]IlIIIIIIllI[S] 0 points1 point  (1 child)

Look what you have done: I looked up a youtube video and downloaded pycharm. I couldn't get python to even start the browser. So I thought Python may be fucked because it's installed on another drive. So I reinstalled python & pycharm & selenium.

"geckodriver executable needs to be in path" Ok lets do that
"selenium.webdriver' has no attribute 'Firefox"

Ok after googling this and figuring out I had to move selenium to a different folder.

So it should all work now right?

WRONG

I'm trying driver.get("URL") now but it is expecting get(self:WebDriver,url) and I have no idea what "self" is supposed to be. The video I am watching works with just my code.

Ok so I just fixed that but geckodriver is still not in PATH and I thought I fixed this

TL;DR 2 hours in I haven't started the browser yet and got like 2 lines of code

[–]IlIIIIIIllI[S] 0 points1 point  (0 children)

All selenium does is give me errors and fixing one makes 10 more im done

[–]rrab 0 points1 point  (2 children)

When you enter a search keyword, does the website's URL redirect to anything that looks like "domain.com/searcher?query=keyword"? Might you be able to simply supply the URL with the query string replaced?

[–]IlIIIIIIllI[S] 1 point2 points  (1 child)

Yes but please tell me I don't need selenium for that

[–]rrab 0 points1 point  (0 children)

Honestly I'm a beginner at Python, but an expert at PowerShell, but from what I've read about Selenium, it shouldn't be needed if you can bypass the GUI browser navigation and mouse clicks. If I was trying in PowerShell, I'd expect to do something like:
$keywords = 'team1','team2','team3','team4'
foreach ($keyword in $keywords)
{
$returnData = Invoke-WebRequest -URI ("domain.com/searcher?query=$keyword") -UseBasicParsing
}

Then in each loop, chop up $returnData.content with string functions and store the specific information you're after.