Skip to content

Unsolved XPath Problem #533

Answered by Kholid060
alpha-code2019 asked this question in Q&A
Discussion options

You must be logged in to vote

Sorry for the late reply, you can try this javascript code

const columns = [
  { text: 'Website', name: 'website' },
  { text: 'Phone', name: 'phone' },
  { text: 'Industry', name: 'industry' },
  { text: 'Company size', name: 'company_size' },
  { text: 'Headquarters', name: 'headquarters' },
  { text: 'Founded', name: 'founded' },
  { text: 'Specialties', name: 'specialties' }
]

const result = [];

const elements = document.querySelectorAll('dl dt');
elements.forEach((element) => {
  const regex = new RegExp(element.innerText, 'i');
  const findColumn = columns.find((column) => regex.test(column.text));

  if (!findColumn) return;

  const columnValue = element.nextElementSibling.inner…

Replies: 9 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Kholid060
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Kholid060
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Kholid060
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants