import asyncio
from nvMapScraper import nvMapScraper
from nvMapPwScraper import nvMapPwScraper

async def main_function():
    await nvMapPwScraper.initiate_scraper()
    selected = {'title': '<b>스테이</b>,<b>머뭄</b>',
                    'link': 'https://www.instagram.com/staymeomoom',
                    'category': '숙박>펜션',
                    'description': '',
                    'telephone': '',
                    'address': '전북특별자치도 군산시 신흥동 63-18',
                    'roadAddress': '전북특별자치도 군산시 절골길 18',
                    'mapx': '1267061254',
                    'mapy': '359864175',
                    'lng': 126.7061254,
                    'lat': 35.9864175}
    
    async with nvMapPwScraper() as pw_scraper:
        new_url = await pw_scraper.get_place_id_url(selected)

    print(new_url)
    nv_scraper = nvMapScraper(new_url) # 이후 동일한 플로우
    await nv_scraper.scrap()
    print(nv_scraper.rawdata)
    return

print("running main_funtion..")
asyncio.run(main_function())