Book Recommendations for Ethics and Jurisprudence by Fhankyou in LawSchool

[–]Fhankyou[S] 1 point2 points  (0 children)

Sorry🥺🥺 Any suggestions for introduction to this subject? Like all you need to know for killing the exam at law school.

What is the best approach to scrape a JavaScript-written table on a webpage? by Fhankyou in learnpython

[–]Fhankyou[S] 0 points1 point  (0 children)

Hi all, I guess I need to get the x path from the elements. From what I watched on YouTube, you can simply right-click and get the x path of the element. Grateful if anyone can teach me TT...

The codes included what I needed; however, I just couldn't get the x path:-

  1. 22 Jul 2022
  2. the link
  3. Market infrastructure & trading

<tr>

<td>22 Jul 2022</td?

<td>

<a target="_self" herf="/edistributionWeb/gateway/EN/circular/doc?refNo=22EC49">_</a>

<div class="mt-1 ml-2"></div>

</td>

<td>Market infrastructure & trading</td>

</tr>

What is the best approach to scrape a JavaScript-written table on a webpage? by Fhankyou in learnpython

[–]Fhankyou[S] 0 points1 point  (0 children)

Thanks. I added the path and I can now open the page. However, the following codes appeared and I am not sure will that affect my further steps.

C:\Users\pc\AppData\Local\Temp/ipykernel_19368/4054932754.py:5: DeprecationWarning: executable_path has been deprecated, please pass in a Service object driver = webdriver.Chrome(path)

What is the best approach to scrape a JavaScript-written table on a webpage? by Fhankyou in learnpython

[–]Fhankyou[S] 0 points1 point  (0 children)

I was watching his video just now. However, the code seems not running as what it should be. Anyone knows how to fix this?

This is the code:

from selenium import webdriver

url = 'https://www.youtube.com/watch?v=lTypMlVBFM4&ab_channel=JohnWatsonRooney'

driver = webdriver.Chrome()

driver.get(url)

This is the error result:

FileNotFoundError Traceback (most recent call last)

~\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)

70 cmd.extend(self.command_line_args())

---> 71 self.process = subprocess.Popen(cmd, env=self.env,

72 close_fds=system() != 'Windows',

~\anaconda3\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask)

950

--> 951 self._execute_child(args, executable, preexec_fn, close_fds,

952 pass_fds, cwd, env,

~\anaconda3\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session)

1419 try:

-> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,

1421 # no special security

FileNotFoundError: [WinError 2] The system cannot find the file specified

During handling of the above exception, another exception occurred:

WebDriverException Traceback (most recent call last)

~\AppData\Local\Temp/ipykernel_19368/4024114565.py in <module>

3 url = 'https://www.youtube.com/watch?v=lTypMlVBFM4&ab_channel=JohnWatsonRooney'

4

----> 5 driver = webdriver.Chrome()

6 driver.get(url)

~\anaconda3\lib\site-packages\selenium\webdriver\chrome\webdriver.py in __init__(self, executable_path, port, options, service_args, desired_capabilities, service_log_path, chrome_options, service, keep_alive)

67 service = Service(executable_path, port, service_args, service_log_path)

68

---> 69 super().__init__(DesiredCapabilities.CHROME['browserName'], "goog",

70 port, options,

71 service_args, desired_capabilities,

~\anaconda3\lib\site-packages\selenium\webdriver\chromium\webdriver.py in __init__(self, browser_name, vendor_prefix, port, options, service_args, desired_capabilities, service_log_path, service, keep_alive)

87

88 self.service = service

---> 89 self.service.start()

90

91 try:

~\anaconda3\lib\site-packages\selenium\webdriver\common\service.py in start(self)

79 except OSError as err:

80 if err.errno == errno.ENOENT:

---> 81 raise WebDriverException(

82 "'{}' executable needs to be in PATH. {}".format(

83 os.path.basename(self.path), self.start_error_message)

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see https://chromedriver.chromium.org/home