User: # Inputs

## Current File
Here is the file I'm looking at. It might be truncated from above and below and, if so, is centered around my cursor.
```/Users/adityajain/Documents/Scraper/scaper.py
import requests
from bs4 import BeautifulSoup
import json
from lxml import html

# def scrape_company_urls(url):
#     response = requests.get(url)
    
#     if response.status_code != 200:
#         print(f"Failed to retrieve page. Status code: {response.status_code}")
#         return None
    
#     soup = BeautifulSoup(response.content, 'html.parser')
    
#     container = soup.find('div', class_='search_cardsContainer__jTGn4')
#     if container:
#         links = container.find_all('a', href=True)
#         # Extract company names, filter out '/de', and remove duplicates
#         company_names = list(set(
#             link['href'].split('/')[-1] for link in links if link['href'] != '/de'
#         ))
#         return json.dumps(company_names)
    
#     return None

# def scrape_company_strengths(url_company):
#     response = requests.get(url_company)
    
#     if response.status_code != 200:
#         print(f"Failed to retrieve page. Status code: {response.status_code}")
#         return None
    
#     soup = BeautifulSoup(response.content, 'html.parser')
    
#     strength_section = soup.find('section', class_='index__topFactorList__J8yDG')
#     if strength_section:
#         strengths = {}
#         for item in strength_section.find_all('li', class_='index__container__yePeh'):
#             header = item.find('h3', class_='p-small-bold')
#             percentage = item.find('h3', class_='h5')
#             if header and percentage:
#                 strengths[header.text.strip()] = percentage.text.strip()
#         return strengths
    
#     return None


# url = 'https://www.kununu.com/de/search?country=de&location=city-2fbd1016-893c-4ef0-bea2-7e709129d312'
# url_company = f"https://www.kununu.com/de/deutsche-post/kultur"
# # company_urls_json = scrape_company_urls(url)
# company_strengths = scrape_company_strengths(url_company)

# print(company_strengths)
# # print(company_urls_json)

def scrape_company_factors(url_company):
    response = requests.get(url_company)
    
    if response.status_code != 200:
        print(f"Failed to retrieve page. Status code: {response.status_code}")
        return None
    
    soup = BeautifulSoup(response.content, 'html.parser')
    
    factors = {'Strengths': {}, 'Weaknesses': {}}
    
    sections = soup.find_all('section', class_='index__topFactorList__J8yDG')
    print(sections)
    if sections:
        for section in sections:
            heading = section.find('h3', class_='index__topFactorHeading__jpBhA')
            if heading:
                category = 'Strengths' if 'Strengthen' in heading.text else 'Weaknesses'
                for item in section.find_all('li', class_='index__container__yePeh'):
                    header = item.find('h3', class_='p-small-bold')
                    percentage = item.find('h3', class_='h5')
                    if header and percentage:
                        factors[category][header.text.strip()] = percentage.text.strip()
    
    return factors

url_company = f"https://www.kununu.com/de/deutsche-post/kultur"
company_factors = scrape_company_factors(url_company)

print(company_factors)

```


User: 

<div class="index__content__HTaY9 index__contentSpacing__+Zgzn"><p class="index__description__1Vael p-base-regular"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">4843 users have given a culture rating. These factors were most frequently selected to describe the company culture.</font></font></p><div class="index__reviewsTypeSwitcherWrapper__h4ua+"><button textuppercase="false" class="index__button__Etj5m index__button__AlOLQ index__secondary__08Tb0 index__semiRounded__QdDxr undefined index__inverted__FzGWG" id="mostVotedTabBtn" type="button"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Most popular</font></font></button><button textuppercase="false" class="index__button__Etj5m index__button__AlOLQ index__secondary__08Tb0 index__semiRounded__QdDxr" id="strengthsAndWeaknessesTabBtn" type="button"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Strengths &amp; Weaknesses</font></font></button></div><hr aria-hidden="true" class="index__separator__PHkW3"><section class="index__topFactorList__J8yDG"><h3 class="index__topFactorHeading__jpBhA h6 h5-tablet"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Strengthen</font></font></h3><ul><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Colleagues help</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">interaction with each other </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Modern</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">43%</font></font></h3><div class="index__progressContainer__hV5JU index__modernProgressBar__PUzSZ"><progress max="100" min="0" value="43"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Behave in a collegial manner</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">interaction with each other </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Modern</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">33%</font></font></h3><div class="index__progressContainer__hV5JU index__modernProgressBar__PUzSZ"><progress max="100" min="0" value="33"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Act economically</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Strategic Direction </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">32%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="32"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Doing your job properly</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Work-life balance </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">31%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="31"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Expect good work quality</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;">Traditional</font></span><font style="vertical-align: inherit;"> Leadership</font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">31%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="31"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Stay longer if necessary</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Work-life balance </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">31%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="31"></progress></div></div></li></ul></section><section class="index__topFactorList__J8yDG"><h3 class="index__topFactorHeading__jpBhA h6 h5-tablet"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Weaken</font></font></h3><ul><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Overloading yourself</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Work-life balance </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">34%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="34"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">putting employees under pressure to perform</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Work-life balance </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">33%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="33"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">overtaxing employees</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;">Traditional</font></span><font style="vertical-align: inherit;"> Leadership</font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">33%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="33"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Everything just for performance</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;">Traditional</font></span><font style="vertical-align: inherit;"> Leadership</font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">32%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="32"></progress></div></div></li><li class="index__container__yePeh"><header class="index__header__nb8a+"><h3 class="p-small-bold"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Stumpf doing his job</font></font></h3><p class="p-tiny-regular text-dark-63"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">Work-life balance </font></font><span class="index__middot__Hq9FN"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">traditional</font></font></span></p></header><div class="index__percentageBar__Jzi+8"><h3 class="h5"><font style="vertical-align: inherit;"><font style="vertical-align: inherit;">29%</font></font></h3><div class="index__progressContainer__hV5JU"><progress max="100" min="0" value="29"></progress></div></div></li></ul></section></div>

Based on the given div above, write a scraping code that fetches the strengths and weaknesses which are the in the class "index__topFactorList__J8yDG". Both have the same class but different sections, so find a solution to get results from both sections. Also note, that they are under a tab with the heading "Stärken & Schwächen", which needs to be clicked to show the other similar section.
Assistant: