How to convert a selenium webelement to string variable in python
<pre><code>from selenium import webdriver
from time import sleep
from selenium.common.exceptions import NoSuchAttributeException
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get('https://www.linkedin.com/jobs/search?locationId=sg%3A0&amp;f_TP=1%2C2&amp;orig=FCTD&amp;trk=jobs_jserp_posted_one_week')
jobtitlebutton = driver.find_elements_by_class_name('job-title-link')
print(jobtitlebutton)
</code></pre>

<p>The output is a selenium webelement in the form of a list. I want to convert it into a string variable so that the list can contain all the jobtitles in text format. 
If I can get assistance in this it will be great. Thanks in advance.</p>

<p>In case, if you need a list of links to each job:</p>

<pre><code>job_list = []
jobtitlebuttons = driver.find_elements_by_class_name('job-title-link')
for job in jobtitlebuttons:
    job_list.append(job.get_attribute('href'))
</code></pre>

<p>In case, if you want just a job titles list:</p>

<pre><code>job_list = []
jobtitlebuttons = driver.find_elements_by_class_name('job-title-text')
for job in jobtitlebuttons:
    job_list.append(job.text)
</code></pre>

<p>Don't forget to accept answer if it solves your problem :) </p>

python selenium