'Selenium - Convert Web page to PDF with WKHTML?

While inside as a Logged In Session as a User with Selenium, currently i'am trying to convert the Web Page to PDF using WKHTML. The PDF that is generated only shows half of the article, as if the web page that was used to be converted was viewed from a non-user that is just visiting the general website.

I'am thinking inside the code, when it reaches to the WKHTML code part, Selenium has terminated the Current Session for the existing User. If that is the case, how would you Keep the existing Session for the User current so it can be used when it gets to the WKHTML Code in the Script ?

Or is it not possible to use Selenium and WKHTML together ?

Below is code,

from selenium import webdriver
import chromedriver_binary  # Adds chromedriver binary to path
from selenium.webdriver.common.by import By
import time
import pdfkit


driver = webdriver.Chrome()
driver.maximize_window() # Makes Full Screen of the Window Browser
time.sleep(4)

url = '  https://www.marketwatch.com/story/nuclear-power-can-be-part-of-the-energy-solution-if-we-can-get-over-our-fear-of-radiation-11647628613?mod=home-page'
                            
driver.get(url)



 ## wkhtml Convert HTML to PDF

path_wkhtmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe'

config = pdfkit.configuration(wkhtmltopdf = path_wkhtmltopdf)

pdfkit.from_url('https://www.marketwatch.com/story/nuclear-power-can-be-part-of-the-energy-solution-if-we-can-get-over-our-fear-of-radiation-11647628613?mod=home-page', r'C:\Users\****\Desktop\article_docs\article1.pdf', configuration=config) 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source