Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7883811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:38:03+00:00 2026-06-03T04:38:03+00:00

I’m trying to scrape the following website, since the XML is malformed and does

  • 0

I’m trying to scrape the following website, since the XML is malformed and does not contain all of the data I need:

http://www.cafebonappetit.com/menu/your-cafe/pitzer

When I fetch the document with Mechanize, however, I only get:

{meta_refresh}
{title "Collins  | Claremont McKenna Cafés | Café Bon Appétit"}
{iframes}
{frames}
{links
 #<Mechanize::Page::Link "Welcome" "http://www.cafebonappetit.com/">
 #<Mechanize::Page::Link "Our Approach" "javascript://">
 #<Mechanize::Page::Link
 "Kitchen Principles"
 "http://www.cafebonappetit.com/our-approach/kitchen-principles">
 .....
 }

Unfortunately, I obviously need to get at what is in the tables (I guess they are iFrames). Any thoughts?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T04:38:04+00:00Added an answer on June 3, 2026 at 4:38 am

    Here’s a simple mech + Nokogiri script that scrapes the menu items.

    require 'rubygems'
    require 'mechanize'
    require 'pp'
    
    agent = Mechanize.new
    url   = "http://www.cafebonappetit.com/menu/your-cafe/pitzer"
    page  = agent.get(url)
    
    #Grab each daily menu
    page.search('div#menu-items > table.my-day-menu-table').each do |menu|
      day = menu.xpath('preceding-sibling::div[1]/a').text.strip
      puts day
      fare = []
      #Collect the menu items
      menu.xpath('tr').each do |item|
        fare << item.xpath('td/strong').map(&:text).join(": ")
      end
      pp fare
    end
    

    Result (excerpt):

    Sunday, May 6th, 2012
    ["Brunch",
     "chef's table: custom omelet bar",
     "main plate: chicken sanchez",
     "meatless chicken and sauce",
     "options: banana pancakes",
     "stocks: beed barley",
     "vegetable minestrone",
     "Lunch",
     "main plate: steamed broccoli",
     "Dinner",
     "chef's table: pasta bar",
     "farm to fork: sauteed rainbow chard",
     "options: mozzarella sticks",
     "ovens: pizza bar",
     "main plate: roasted herb chicken",
     "baked ziti pasta",
     "steamed carrots and parsnips"]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
I need a function that will clean a strings' special characters. I do NOT
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I used javascript for loading a picture on my website depending on which small
I am trying to render a haml file in a javascript response like so:
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.