BeautifulSoup does not extract commet tags in dynamic page
up vote
0
down vote
favorite
What I need: Count the number of reviews under an extension in Chrome Store in all languages.
What I did: Tried BeautifulSoup to extract a certain tag. I reserched the html-code of the page and found a review tag:
Tried this code:
from bs4 import BeautifulSoup
import requests
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html5lib')
comments = soup.find_all('div', class_ = 'ba-bc-Xb ba-ua-zl-Xb')
But print(comments)
shows that the array is empty.
I am stuck at the moment and I see that further I need to handle two problems:
How to cope with select language buttom? How to count reviews in all languages if by default only one language is selected.
The reviews are stored in different tabs. I read about dynamically extract it but didn't get a point.
python selenium-webdriver web-scraping beautifulsoup
add a comment |
up vote
0
down vote
favorite
What I need: Count the number of reviews under an extension in Chrome Store in all languages.
What I did: Tried BeautifulSoup to extract a certain tag. I reserched the html-code of the page and found a review tag:
Tried this code:
from bs4 import BeautifulSoup
import requests
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html5lib')
comments = soup.find_all('div', class_ = 'ba-bc-Xb ba-ua-zl-Xb')
But print(comments)
shows that the array is empty.
I am stuck at the moment and I see that further I need to handle two problems:
How to cope with select language buttom? How to count reviews in all languages if by default only one language is selected.
The reviews are stored in different tabs. I read about dynamically extract it but didn't get a point.
python selenium-webdriver web-scraping beautifulsoup
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
What I need: Count the number of reviews under an extension in Chrome Store in all languages.
What I did: Tried BeautifulSoup to extract a certain tag. I reserched the html-code of the page and found a review tag:
Tried this code:
from bs4 import BeautifulSoup
import requests
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html5lib')
comments = soup.find_all('div', class_ = 'ba-bc-Xb ba-ua-zl-Xb')
But print(comments)
shows that the array is empty.
I am stuck at the moment and I see that further I need to handle two problems:
How to cope with select language buttom? How to count reviews in all languages if by default only one language is selected.
The reviews are stored in different tabs. I read about dynamically extract it but didn't get a point.
python selenium-webdriver web-scraping beautifulsoup
What I need: Count the number of reviews under an extension in Chrome Store in all languages.
What I did: Tried BeautifulSoup to extract a certain tag. I reserched the html-code of the page and found a review tag:
Tried this code:
from bs4 import BeautifulSoup
import requests
page = requests.get(url)
soup = BeautifulSoup(page.content, 'html5lib')
comments = soup.find_all('div', class_ = 'ba-bc-Xb ba-ua-zl-Xb')
But print(comments)
shows that the array is empty.
I am stuck at the moment and I see that further I need to handle two problems:
How to cope with select language buttom? How to count reviews in all languages if by default only one language is selected.
The reviews are stored in different tabs. I read about dynamically extract it but didn't get a point.
python selenium-webdriver web-scraping beautifulsoup
python selenium-webdriver web-scraping beautifulsoup
edited Nov 21 at 16:24
ewwink
6,72922233
6,72922233
asked Nov 21 at 8:31
Sergei Shumilin
348
348
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47
add a comment |
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47
add a comment |
2 Answers
2
active
oldest
votes
up vote
0
down vote
You could use selenium to perform the tasks and waits for page changes and extract the review count from the PaginationMessage
. Tested with a few links. You may need to add error handling for items with no reviews. There also seems to be some POST XHR activity yielding review JSON strings that you may wish to explore.
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
url = 'https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en/'
#url = 'https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en/'
d = webdriver.Chrome()
d.get(url)
WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.ID, ':21'))).click()
ActionChains(d).click_and_hold(WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca')))).perform()
languageSelection = WebDriverWait(d, 5).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, '.g-aa-ca-ma-x-L')))
languageSelection[1].click()
s= WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.Aa.dc-tf + span'))).text
print(s.split()[-1])
d.quit()
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
|
show 1 more comment
up vote
0
down vote
try this
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get('https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en')
wait = WebDriverWait(driver, 5)
wait.until(EC.visibility_of_element_located((By.ID, ':21'))).click()
wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca'))
).click()
english = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('English: ' + english.split()[-1])
wait.until(
EC.visibility_of_element_located((By.XPATH, '//div[@class="g-aa-ca-ma-x-L" and text() = "All languages"]'))
).click()
wait.until_not(EC.text_to_be_present_in_element((By.XPATH, '//div[@class="ah-mg-j"]/span'), english))
time.sleep(2)
AllCount = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('All languages: ' + AllCount.split()[-1])
driver.close()
Thank you for help. It returns:English: 128 All languages: 168
It's not the total number on all tabs
– Sergei Shumilin
Nov 21 at 16:52
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You could use selenium to perform the tasks and waits for page changes and extract the review count from the PaginationMessage
. Tested with a few links. You may need to add error handling for items with no reviews. There also seems to be some POST XHR activity yielding review JSON strings that you may wish to explore.
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
url = 'https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en/'
#url = 'https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en/'
d = webdriver.Chrome()
d.get(url)
WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.ID, ':21'))).click()
ActionChains(d).click_and_hold(WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca')))).perform()
languageSelection = WebDriverWait(d, 5).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, '.g-aa-ca-ma-x-L')))
languageSelection[1].click()
s= WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.Aa.dc-tf + span'))).text
print(s.split()[-1])
d.quit()
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
|
show 1 more comment
up vote
0
down vote
You could use selenium to perform the tasks and waits for page changes and extract the review count from the PaginationMessage
. Tested with a few links. You may need to add error handling for items with no reviews. There also seems to be some POST XHR activity yielding review JSON strings that you may wish to explore.
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
url = 'https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en/'
#url = 'https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en/'
d = webdriver.Chrome()
d.get(url)
WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.ID, ':21'))).click()
ActionChains(d).click_and_hold(WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca')))).perform()
languageSelection = WebDriverWait(d, 5).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, '.g-aa-ca-ma-x-L')))
languageSelection[1].click()
s= WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.Aa.dc-tf + span'))).text
print(s.split()[-1])
d.quit()
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
|
show 1 more comment
up vote
0
down vote
up vote
0
down vote
You could use selenium to perform the tasks and waits for page changes and extract the review count from the PaginationMessage
. Tested with a few links. You may need to add error handling for items with no reviews. There also seems to be some POST XHR activity yielding review JSON strings that you may wish to explore.
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
url = 'https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en/'
#url = 'https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en/'
d = webdriver.Chrome()
d.get(url)
WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.ID, ':21'))).click()
ActionChains(d).click_and_hold(WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca')))).perform()
languageSelection = WebDriverWait(d, 5).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, '.g-aa-ca-ma-x-L')))
languageSelection[1].click()
s= WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.Aa.dc-tf + span'))).text
print(s.split()[-1])
d.quit()
You could use selenium to perform the tasks and waits for page changes and extract the review count from the PaginationMessage
. Tested with a few links. You may need to add error handling for items with no reviews. There also seems to be some POST XHR activity yielding review JSON strings that you may wish to explore.
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.action_chains import ActionChains
url = 'https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en/'
#url = 'https://chrome.google.com/webstore/detail/https-everywhere/gcbommkclmclpchllfjekcdonpmejbdp?hl=en/'
d = webdriver.Chrome()
d.get(url)
WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.ID, ':21'))).click()
ActionChains(d).click_and_hold(WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca')))).perform()
languageSelection = WebDriverWait(d, 5).until(EC.visibility_of_all_elements_located((By.CSS_SELECTOR, '.g-aa-ca-ma-x-L')))
languageSelection[1].click()
s= WebDriverWait(d, 5).until(EC.visibility_of_element_located((By.CSS_SELECTOR, '.Aa.dc-tf + span'))).text
print(s.split()[-1])
d.quit()
edited Nov 21 at 14:07
answered Nov 21 at 12:57
QHarr
26.7k81839
26.7k81839
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
|
show 1 more comment
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Thanks for the answer. The result is 110 what is equals to the number of reviews on the first tab in russian, I need to count overall number of reviews in all languages.
– Sergei Shumilin
Nov 21 at 13:53
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
Two ticks and I will update.
– QHarr
Nov 21 at 13:54
try the updated script
– QHarr
Nov 21 at 14:07
try the updated script
– QHarr
Nov 21 at 14:07
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
168. It's still not the overall number. But I'm grateful for your work. When it script is performed I see how Chrome browser works in real time (it opens and turn pages on its own) but if the number of tabs are very big - it means that I need to wait a lot of time the webdriver to extract it.
– Sergei Shumilin
Nov 21 at 14:30
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
I'm confused. If I use your link and go to the reviews tab and select all languages I see 168 as the number of reviews. What is the expected number?
– QHarr
Nov 21 at 14:37
|
show 1 more comment
up vote
0
down vote
try this
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get('https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en')
wait = WebDriverWait(driver, 5)
wait.until(EC.visibility_of_element_located((By.ID, ':21'))).click()
wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca'))
).click()
english = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('English: ' + english.split()[-1])
wait.until(
EC.visibility_of_element_located((By.XPATH, '//div[@class="g-aa-ca-ma-x-L" and text() = "All languages"]'))
).click()
wait.until_not(EC.text_to_be_present_in_element((By.XPATH, '//div[@class="ah-mg-j"]/span'), english))
time.sleep(2)
AllCount = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('All languages: ' + AllCount.split()[-1])
driver.close()
Thank you for help. It returns:English: 128 All languages: 168
It's not the total number on all tabs
– Sergei Shumilin
Nov 21 at 16:52
add a comment |
up vote
0
down vote
try this
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get('https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en')
wait = WebDriverWait(driver, 5)
wait.until(EC.visibility_of_element_located((By.ID, ':21'))).click()
wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca'))
).click()
english = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('English: ' + english.split()[-1])
wait.until(
EC.visibility_of_element_located((By.XPATH, '//div[@class="g-aa-ca-ma-x-L" and text() = "All languages"]'))
).click()
wait.until_not(EC.text_to_be_present_in_element((By.XPATH, '//div[@class="ah-mg-j"]/span'), english))
time.sleep(2)
AllCount = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('All languages: ' + AllCount.split()[-1])
driver.close()
Thank you for help. It returns:English: 128 All languages: 168
It's not the total number on all tabs
– Sergei Shumilin
Nov 21 at 16:52
add a comment |
up vote
0
down vote
up vote
0
down vote
try this
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get('https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en')
wait = WebDriverWait(driver, 5)
wait.until(EC.visibility_of_element_located((By.ID, ':21'))).click()
wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca'))
).click()
english = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('English: ' + english.split()[-1])
wait.until(
EC.visibility_of_element_located((By.XPATH, '//div[@class="g-aa-ca-ma-x-L" and text() = "All languages"]'))
).click()
wait.until_not(EC.text_to_be_present_in_element((By.XPATH, '//div[@class="ah-mg-j"]/span'), english))
time.sleep(2)
AllCount = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('All languages: ' + AllCount.split()[-1])
driver.close()
try this
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
driver = webdriver.Chrome()
driver.get('https://chrome.google.com/webstore/detail/evernote-web-clipper/pioclpoplcdbaefihamjohnefbikjilc?hl=en')
wait = WebDriverWait(driver, 5)
wait.until(EC.visibility_of_element_located((By.ID, ':21'))).click()
wait.until(
EC.visibility_of_element_located((By.CSS_SELECTOR, '.h-z-Ba-ca.ga-dd-Va.g-aa-ca'))
).click()
english = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('English: ' + english.split()[-1])
wait.until(
EC.visibility_of_element_located((By.XPATH, '//div[@class="g-aa-ca-ma-x-L" and text() = "All languages"]'))
).click()
wait.until_not(EC.text_to_be_present_in_element((By.XPATH, '//div[@class="ah-mg-j"]/span'), english))
time.sleep(2)
AllCount = driver.find_element_by_xpath('//div[@class="ah-mg-j"]/span').text
print('All languages: ' + AllCount.split()[-1])
driver.close()
answered Nov 21 at 16:21
ewwink
6,72922233
6,72922233
Thank you for help. It returns:English: 128 All languages: 168
It's not the total number on all tabs
– Sergei Shumilin
Nov 21 at 16:52
add a comment |
Thank you for help. It returns:English: 128 All languages: 168
It's not the total number on all tabs
– Sergei Shumilin
Nov 21 at 16:52
Thank you for help. It returns:
English: 128 All languages: 168
It's not the total number on all tabs– Sergei Shumilin
Nov 21 at 16:52
Thank you for help. It returns:
English: 128 All languages: 168
It's not the total number on all tabs– Sergei Shumilin
Nov 21 at 16:52
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53407963%2fbeautifulsoup-does-not-extract-commet-tags-in-dynamic-page%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I guess you should add page number and required language to your URL as parameters, but it depends on how server set to send data
– Andersson
Nov 21 at 9:07
Can you provide the initial URL for testing?
– QHarr
Nov 21 at 9:35
chrome.google.com/webstore/detail/evernote-web-clipper/… for ex
– Sergei Shumilin
Nov 21 at 10:47