#๐Ÿ”’ this was working fine but now I changed something and it just outputs a mostly blank .xlsx file

16 messages ยท Page 1 of 1 (latest)

raw vortexBOT
#

@slim swan

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

slim swan
#

wait how do i attach a large .py in here

quartz frigate
slim swan
polar locust
#

use the debugger to step through the code

#

and figure out when exactly the variables stop holding the values that you're expecting them to hold

#

or use print() to print the values

slim swan
#

uh so i trimmed the code down and pinpointed the issue

#

here is the issue

#

I was using this libary all night and now suddenly it doesn't worry

#
from websearch import WebSearch as web

locations = ["chicago", "atlanta", "new york"]  # list of major locations in the midwest to use

def search(location):  # this function contains our search parameters and outputs a list of urls
    search_results = []
    print(f"Searching for pages related to {location}...")  # Debug print
    for page in web(
            location + "\"Asian\" \"pageant\" \"2024\" -site:linkedin.com -site:tiktok.com "
                       "-site:threads.net -site:google.com -site:facebook.com -site:instagram.com "
                       "-site:maps.google.com -site:reddit.com"
    ).pages[:2]:
        print(f"Found page: {page}")  # Debug print
        search_results.append(page)
    return search_results


# ... Your existing code ...

for location in locations:
    print(f"Processing location: {location}")  # Debug print
    URLs = search(location)
    if not URLs:  # Check if the URLs list is empty
        print(f"No URLs found for {location}.")  # Debug print
    for URL in URLs:
        print("hello world")  # This should now print if URLs are found
#

from websearch import WebSearch as web
just suddenly stopped working

#

i was using it with that exact code fine for multiple days but now it won't do any searchs

raw vortexBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.