Spyke

Posts

teenagers·TeenagersbySaki

How do I complete assignments faster

There's no community for school so I thought I'd ask here

Basically at my school we don't have much homework and we do almost all the assignments/projects in class. But I'm so slow that I can't possibly complete whatever we have to do in only 20-45 minutes, so I have to continue at home. But sometimes we can't do that and have to turn in at the end of the class, and by then I've only barely started. I seem to work more efficiently at home though (or at least I feel like I'm working more efficiently).

Does anyone have any advice/tips to help mitigate this? Tia

View original on lemmy.blahaj.zone
5
learn_programming·Learn ProgrammingbySaki

Can only send post requests to root page in JS

Hi, I have this function that is supposed to upload a file stream to another page:

async function getData() {
    const vocadata = await fetch('http://localhost:3000/upload/',
        {
            method: "POST",
            headers: {
                "Content-Type": "multipart/form-data",
            },
            body: data,
        });
    console.log(vocadata);
};

The problem is though, no matter what URL I enter in the first argument, it always posts the request to /. How can I fix this?

View original on lemmy.blahaj.zone
1
selenium·Selenium Web Browser AutomationbySaki

driver.find_elements returns empty list (python)

I'm trying to get images from a duckduckgo search, this is my function currently

def search(query):
    driver.get(f"https://duckduckgo.com/?q={query}&iax=images&ia=images")
    res = driver.find_elements(By.CLASS_NAME, "tile--img__img")
    while True:
        logger.debug(res)
        if len(res) == 0:
            time.sleep(1)
        else:
            break
            logger.info("Results pulled")

But no matter how long it waits, res always returns empty, and when I tried to do the same with find_element I got a nonexistent element error.

Inspect element on one of the images:

View original on lemmy.blahaj.zone
2

You reached the end